当前位置:网站首页>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
边栏推荐
- AI目标分割能力,无需绿幕即可实现快速视频抠图
- A new generation of ultra-safe cellular batteries, Sihao Airun goes on sale starting at 139,900 yuan
- Meshlab&Open3D SOR滤波
- 浏览器存储
- How to Integrate Your Service Registry with Istio?
- STM32 CAN filter configuration details
- 【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
- 腾讯云原生:Areaki Mesh 在 2022 冬奥会视频直播应用中的服务网格实践
- 【云享新鲜】社区周刊·Vol.73- DTSE Tech Talk:1小时深度解读SaaS应用系统设计
- 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
猜你喜欢
Feign 从注册到调用原理分析
程序员如何优雅地解决线上问题?
How do programmers solve online problems gracefully?
小程序插件如何帮助开发者受益?
Sparse representation - study notes
Fault 007: The dexp derivative is inexplicably interrupted
[5 days countdown] to explore the secret behind the great quality promotion, gift waiting for you to take of $one thousand
Qt获取文件夹下所有文件
如何使用 Authing 单点登录,集成 Discourse 论坛?
达梦更换正式授权dm.key
随机推荐
win10系统重装,无法登录进行同步的情况下chrome数据恢复
大中型网站列表页翻页过多怎么优化?
测试发文
SCHEMA solves the puzzle
将同级数据处理成树形数据
通讯录(静态版)(C语言)(VS)
pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一个小时之前的所有数据(筛选一个小时的范围数据)
【倒计时5天】探索音画质量提升背后的秘密,千元大礼等你来拿
如何成功通过 CKA 考试?
【公开课预告】:超分辨率技术在视频画质增强领域的研究与应用
How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!
(ES6 and above and TS) Map object to array
kubernetes之DaemonSet以及滚动更新
Js手写函数之new的模拟实现
Do wildcard SSL certificates not support multiple domains?
A new generation of ultra-safe cellular batteries, Sihao Airun goes on sale starting at 139,900 yuan
Deep understanding of Istio - advanced practice of cloud native service mesh
批量任务导入到数据库中
.NET性能优化-使用SourceGenerator-Logger记录日志
Towhee 每周模型