当前位置:网站首页>SQL function SQUARE
SQL function SQUARE
2022-08-01 12:42:00 【User 7741497】
SQL function SQUARE
A scalar numeric function that returns the square of a number.
Outline
SQUARE(numeric-expression)
parameter
numeric-expression
- An expression that resolves to a numeric value.
SQUARE
returns NUMERIC
or DOUBLE
data types.If numeric-expression
is of data type DOUBLE
, SQUARE
returns DOUBLE
; otherwise, it returns NUMERIC
.
Description
SQUARE
Returns the square of a numeric expression.If a NULL
value is passed, SQUARE
returns NULL
.
SQUARE
returns the same precision and scale as the SQL
multiply operator.
Example
The following embedded SQL
example returns the square of the integer 0
to 10
:
/// d ##class(PHA.TEST.SQLFunction).Square()ClassMethod Square(){s a = 0while a < 11 {&sql(SELECT SQUARE(:a) INTO :b)if SQLCODE '= 0 {w !,"Error code ",SQLCODE} else {w !,"The square of ",a," = ",bs a = a + 1}}}
DHC-APP>d ##class(PHA.TEST.SQLFunction).Square()The square of 0 = 0The square of 1 = 1The square of 2 = 4The square of 3 = 9The square of 4 = 16The square of 5 = 25The square of 6 = 36The square of 7 = 49The square of 8 = 64The square of 9 = 81The square of 10 = 100
边栏推荐
- 如何利用DevExpress控件绘制流程图?看完这篇文章就懂了!
- 实现集中式身份认证管理的案例
- MNIST是什么(plist是什么意思)
- 一文带你彻底厘清 Kubernetes 中的证书工作机制
- 【面试高频题】难度 1.5/5,二分经典运用题
- Audio and Video Technology Development Weekly | 256
- [CLion] CLion always prompts "This file does not belong to any project target xxx" solution
- 小程序插件如何帮助开发者受益?
- 程序员如何优雅地解决线上问题?
- 批量任务导入到数据库中
猜你喜欢
找出相同属性值的对象 累加数量 汇总
新一代超安全蜂窝电池, 思皓爱跑上市13.99万元起售
稀疏表示--学习笔记
这项工作事关中小学生生命安全!五部门作出联合部署
初级必备:单例模式的7个问题
STM32 CAN filter configuration details
深入解析volatile关键字
The CAN communication standard frame and extended frame is introduced
HMS Core音频编辑服务音源分离与空间音频渲染,助力快速进入3D音频的世界
CloudCompare & PCL ICP registration (point to face)
随机推荐
Sparse representation - study notes
.NET性能优化-使用SourceGenerator-Logger记录日志
R语言ggplot2可视化:使用ggpubr包的ggscatter函数可视化散点图、使用xscale函数指定X轴坐标轴度量调整方式、设置x轴坐标为scientific使用科学计数法显示坐标值
易周金融分析 | 银行ATM机智能化改造提速;互联网贷款新规带来挑战
表连接详解
达梦更换正式授权dm.key
[Cloud Enjoying Freshness] Community Weekly Vol.73- DTSE Tech Talk: 1 hour in-depth interpretation of SaaS application system design
[Open class preview]: Research and application of super-resolution technology in the field of video image quality enhancement
SQL函数 %SQLSTRING
如何使用 Authing 单点登录,集成 Discourse 论坛?
安装apex报错
Apex installation error
蔚来又一新品牌披露:产品价格低于20万
深入理解 Istio —— 云原生服务网格进阶实战
Software designer test center summary (interior designer personal summary)
腾讯云原生:Areaki Mesh 在 2022 冬奥会视频直播应用中的服务网格实践
软件设计师考点汇总(室内设计师个人总结)
Detailed explanation of table join
R语言诊断ARIMA模型:forecast包构建了一个ARIMA模型、使用checkresiduals函数诊断ARIMA模型、并进行结果解读(拟合较差的ARIMA模型具有的特点)
SCHEMA解惑