当前位置:网站首页>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边栏推荐
- Stone Technology builds hard-core brand power and continues to expand the global market
- ECCV22|只能11%的参数就能优于Swin,微软提出快速预训练蒸馏方法TinyViT
- Find objects with the same property value Cumulative number Summarize
- R语言拟合ARIMA模型:使用forecast包中的auto.arima函数自动搜索最佳参数组合、模型阶数(p,d,q)、设置seasonal参数指定在模型中是否包含季节信息
- Dameng replaces the officially authorized dm.key
- MNIST是什么(plist是什么意思)
- 一文带你读懂云原生、微服务与高可用
- 字体反爬之好租
- Beyond Compare 4 trial period expires
- 阿里云官方 Redis 开发规范
猜你喜欢

Promise learning (1) What is Promise?how to use?How to solve callback hell?

Stone Technology builds hard-core brand power and continues to expand the global market

Beyond Compare 4 trial period expires

【随心笔记】假期快过去了,都干了点什么

Beyond Compare 4 试用期到期

Promise learning (2) An article takes you to quickly understand the common APIs in Promise

字体反爬之好租

安装apex报错

蔚来又一新品牌披露:产品价格低于20万

C#/VB.NET 将PPT或PPTX转换为图像
随机推荐
bpmn-process-designer基础上进行自定义样式(工具、元素、菜单)
收藏|机械工程师面试常问问题
2022 Go ecosystem rpc framework Benchmark
ddl and dml in sql (the difference between database table and view)
找出相同属性值的对象 累加数量 汇总
STM32 CAN filter configuration details
程序员如何优雅地解决线上问题?
千万级乘客排队系统重构&压测方案——总结篇
那些利用假期学习的职场人,后来都怎么样了?
音视频技术开发周刊 | 256
Several methods of appending elements are commonly used in js: append, appendTo, after, before, insertAfter, insertBefore, appendChild
leetcode/子矩阵元素和
Promise learning (4) The ultimate solution for asynchronous programming async + await: write asynchronous code in a synchronous way
【随心笔记】假期快过去了,都干了点什么
[Open class preview]: Research and application of super-resolution technology in the field of video image quality enhancement
冰冰学习笔记:gcc、gdb等工具的使用
Qt获取文件夹下所有文件
JS数据类型转换完全攻略
Hot review last week (7.25 7.31)
Tencent Cloud Native: Service Mesh Practice of Areaki Mesh in the 2022 Winter Olympics Video Live Application