当前位置:网站首页>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
边栏推荐
- 语音聊天app源码——语音聊天派对
- R language ggplot2 visualization: use ggpubr package ggscatter function visualization scatterplot, use xscale wasn't entirely specified X axis measurement adjustment function, set the X coordinate for
- 重庆市大力实施智能建造,推动建筑业数字化转型,助力“建造强市”
- pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一个小时之前的所有数据(筛选一个小时的范围数据)
- Aeraki Mesh became CNCF sandbox project
- (ES6以上以及TS) Map对象转数组
- CAN通信标准帧和扩展帧介绍
- [Community Star Selection] Issue 24 August Update Plan | Keep writing, refuse to lie down!More original incentive packages, as well as Huawei WATCH FIT watches!
- 新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
- 达梦更换正式授权dm.key
猜你喜欢
音视频技术开发周刊 | 256
How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!
【likeshop】回收租凭系统100%开源无加密 商城+回收+租赁
2022 Go ecosystem rpc framework Benchmark
达梦更换正式授权dm.key
Dapr 与 NestJs ,实战编写一个 Pub & Sub 装饰器
爱可可AI前沿推介(8.1)
Process sibling data into tree data
Alibaba Cloud Official Redis Development Specification
Beyond Compare 4 试用期到期
随机推荐
新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行
Data frame and remote frame of CAN communication
【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
易周金融分析 | 银行ATM机智能化改造提速;互联网贷款新规带来挑战
Visualization of lag correlation of two time series data in R language: use the ccf function of the forecast package to draw the cross-correlation function, and analyze the lag correlation according t
R语言检验时间序列的平稳性:使用tseries包的adf.test函数实现增强的Dickey-Fuller(ADF)检验、检验时序数据是否具有均值回归特性(平稳性)、具有均值回归特性的案例
OpenHarmony高校技术俱乐部计划发布
如何使用 Authing 单点登录,集成 Discourse 论坛?
C language implementation!20000 in 4 seconds
leetcode/子矩阵元素和
如何成功通过 CKA 考试?
Aeraki Mesh 加入 CNCF 云原生全景图
表连接详解
MNIST是什么(plist是什么意思)
sql中ddl和dml(数据库表与视图的区别)
R语言ggplot2可视化:使用ggpubr包的ggscatter函数可视化散点图、使用xscale函数指定X轴坐标轴度量调整方式、设置x轴坐标为scientific使用科学计数法显示坐标值
Promise to learn several key questions (3) the Promise - state change, execution sequence and mechanism, multitasking series, abnormal penetration, interrupt the chain of Promise
How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!
CAN通信的数据帧和远程帧
SCHEMA解惑