当前位置:网站首页>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边栏推荐
猜你喜欢

英特尔全方位打造算力基础,助推“算”赋百业

redis6 跟着b站尚硅谷学习

那些利用假期学习的职场人,后来都怎么样了?

Excel表格打印时不打印标记填充颜色

如何利用DevExpress控件绘制流程图?看完这篇文章就懂了!

Apex installation error

The CAN communication standard frame and extended frame is introduced
![[5 days countdown] to explore the secret behind the great quality promotion, gift waiting for you to take of $one thousand](/img/de/1e6069e84183d1400c90a6ec574f72.png)
[5 days countdown] to explore the secret behind the great quality promotion, gift waiting for you to take of $one thousand

博弈论(Depu)与孙子兵法(42/100)

故障007:dexp导数莫名中断
随机推荐
这项工作事关中小学生生命安全!五部门作出联合部署
各位大拿,安装Solaris 11.4操作系统,在安装数据库依赖包的时候包这个错,目前无原厂支持,也无安装盘,联网下载后报这个错,请教怎么解决?
Promise to learn several key questions (3) the Promise - state change, execution sequence and mechanism, multitasking series, abnormal penetration, interrupt the chain of Promise
通配符SSL证书不支持多域名吗?
程序员如何优雅地解决线上问题?
Solve vscode input! Unable to quickly generate skeletons (three methods for the new version of vscode to quickly generate skeletons)
pgAdmin 4 v6.12 发布,PostgreSQL 开源图形化管理工具
冰冰学习笔记:gcc、gdb等工具的使用
Promise learning (1) What is Promise?how to use?How to solve callback hell?
阿里云官方 Redis 开发规范
R language fitting ARIMA model: use the auto.arima function in the forecast package to automatically search for the best parameter combination, model order (p, d, q), set the seasonal parameter to spe
Several methods of appending elements are commonly used in js: append, appendTo, after, before, insertAfter, insertBefore, appendChild
Qt get all files in a folder
OpenHarmony高校技术俱乐部计划发布
实现集中式身份认证管理的案例
收藏|机械工程师面试常问问题
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
【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
Aeraki Mesh Joins CNCF Cloud Native Panorama
Envoy 源码流程图