当前位置:网站首页>SQL函数 SQUARE
SQL函数 SQUARE
2022-08-01 12:02:00 【用户7741497】
SQL函数 SQUARE
返回数字平方的标量数值函数。
大纲
SQUARE(numeric-expression)
参数
numeric-expression
- 解析为数值的表达式。
SQUARE
返回 NUMERIC
或 DOUBLE
数据类型。如果 numeric-expression
是数据类型 DOUBLE
,则 SQUARE
返回 DOUBLE
;否则,它返回 NUMERIC
。
描述
SQUARE
返回数值表达式的平方。如果传递 NULL
值,SQUARE
返回 NULL
。
SQUARE
返回的精度和小数位数与 SQL
乘法运算符返回的相同。
示例
以下嵌入式 SQL
示例返回整数 0
到 10
的平方:
/// d ##class(PHA.TEST.SQLFunction).Square()
ClassMethod Square()
{
s a = 0
while a < 11 {
&sql(
SELECT SQUARE(:a) INTO :b
)
if SQLCODE '= 0 {
w !,"Error code ",SQLCODE
} else {
w !,"The square of ",a," = ",b
s a = a + 1
}
}
}
DHC-APP>d ##class(PHA.TEST.SQLFunction).Square()
The square of 0 = 0
The square of 1 = 1
The square of 2 = 4
The square of 3 = 9
The square of 4 = 16
The square of 5 = 25
The square of 6 = 36
The square of 7 = 49
The square of 8 = 64
The square of 9 = 81
The square of 10 = 100
边栏推荐
- Audio and Video Technology Development Weekly | 256
- 【面试高频题】难度 1.5/5,二分经典运用题
- MVVM响应式
- JS数据类型转换完全攻略
- 通配符SSL证书不支持多域名吗?
- R语言ggplot2可视化:使用ggpubr包的ggscatter函数可视化散点图、使用xscale函数指定X轴坐标轴度量调整方式、设置x轴坐标为scientific使用科学计数法显示坐标值
- 【likeshop】回收租凭系统100%开源无加密 商城+回收+租赁
- sql中ddl和dml(数据库表与视图的区别)
- Meshlab & Open3D SOR filtering
- 深入解析volatile关键字
猜你喜欢
Alibaba Cloud Official Redis Development Specification
Favorites|Mechanical Engineer Interview Frequently Asked Questions
Qt get all files in a folder
Online - GCeasy GC log analysis tools
2022 Go ecosystem rpc framework Benchmark
安装apex报错
将同级数据处理成树形数据
重磅消息 | Authing 实现与西门子低代码平台的集成
bpmn-process-designer基础上进行自定义样式(工具、元素、菜单)
并发编程10大坑,你踩过几个?
随机推荐
R语言ggplot2可视化:使用ggpubr包的geom_exec函数执行geom_*函数(没有任何参数需要放置在aes中)
bat countdown code
新一代超安全蜂窝电池, 思皓爱跑上市13.99万元起售
Istio Meetup China:全栈服务网格 - Aeraki 助你在 Istio 服务网格中管理任何七层流量
Pytest电商项目实战(下)
Promise learning (2) An article takes you to quickly understand the common APIs in Promise
Apex installation error
win10系统重装,无法登录进行同步的情况下chrome数据恢复
实现集中式身份认证管理的案例
.NET analyzes the LINQ framework in depth (three: the elegant prelude of LINQ)
[CLion] CLion always prompts "This file does not belong to any project target xxx" solution
Several methods of appending elements are commonly used in js: append, appendTo, after, before, insertAfter, insertBefore, appendChild
Favorites|Mechanical Engineer Interview Frequently Asked Questions
How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!
MMF的初步介绍:一个规范化的视觉-语言多模态任务框架
深入解析volatile关键字
redis6 跟着b站尚硅谷学习
各位大拿,安装Solaris 11.4操作系统,在安装数据库依赖包的时候包这个错,目前无原厂支持,也无安装盘,联网下载后报这个错,请教怎么解决?
一篇文章,带你详细了解华为认证体系证书(1)
【likeshop】回收租凭系统100%开源无加密 商城+回收+租赁