当前位置:网站首页>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边栏推荐
- 【云享新鲜】社区周刊·Vol.73- DTSE Tech Talk:1小时深度解读SaaS应用系统设计
- 如何使用 Authing 单点登录,集成 Discourse 论坛?
- MVVM响应式
- 通配符SSL证书不支持多域名吗?
- Qt get all files in a folder
- CloudCompare & PCL ICP registration (point to face)
- Data frame and remote frame of CAN communication
- R语言两个时间序列数据的滞后相关性可视化:使用forecast包的ccf函数绘制交叉相关函数,根据可视化结果分析滞后相关性
- 【社区明星评选】第24期 8月更文计划 | 笔耕不辍,拒绝躺平!更多原创激励大礼包,还有华为WATCH FIT手表!
- Aeraki Mesh 正式成为 CNCF 沙箱项目
猜你喜欢

重磅消息 | Authing 实现与西门子低代码平台的集成

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

Apex installation error

深入解析volatile关键字

小程序插件如何帮助开发者受益?

CloudCompare & PCL ICP registration (point to face)

达梦更换正式授权dm.key

爱可可AI前沿推介(8.1)

并发编程10大坑,你踩过几个?

Pytest e-commerce project combat (below)
随机推荐
如何设计一个分布式 ID 发号器?
语音聊天app源码——语音聊天派对
Audio and Video Technology Development Weekly | 256
Alibaba Cloud Official Redis Development Specification
如何利用DevExpress控件绘制流程图?看完这篇文章就懂了!
Pytest电商项目实战(下)
阿里云官方 Redis 开发规范
ddl and dml in sql (the difference between database table and view)
Complete Raiders of JS Data Type Conversion
[CLion] CLion always prompts "This file does not belong to any project target xxx" solution
如何获取微信视频号的地址(微信公众号的链接地址)
故障007:dexp导数莫名中断
2022 Go ecosystem rpc framework Benchmark
[Open class preview]: Research and application of super-resolution technology in the field of video quality enhancement
那些利用假期学习的职场人,后来都怎么样了?
华硕和微星多款产品将升级英特尔Arc A380和A310显卡
How to get the address of WeChat video account (link address of WeChat public account)
【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
bat countdown code
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