当前位置:网站首页>SQL function SQRT
SQL function SQRT
2022-08-01 12:41:00 【User 7741497】
SQL function SQRT
A numeric function that returns the square root of a given numeric expression.
Outline
SQRT(numeric-expression){fn SQRT(numeric-expression)}parameter
numeric-expression- An expression that resolves to a positive number that computes the square root.
SQRT returns NUMERIC or DOUBLE data types.SQRT returns DOUBLE if numeric-expression is of data type DOUBLE; otherwise, it returns NUMERIC.
Description
SQRT Returns the square root of numeric-expression.numeric-expression must be a positive number.Negative numeric expressions (except -0) generate SQLCODE -400 errors.If a NULL value is passed, SQRT returns NULL.
SQRT returns a value with a precision of 36 and a scale of 18.
SQRT can be specified as a regular scalar function or as a ODBC scalar function (using curly brace syntax).
Example
The following examples show two forms of SQRT syntax.Both return the square root of 49:
SELECT SQRT(49) AS SRoot,{fn SQRT(49)} AS ODBCSRoot7 7The following embedded SQL example returns the square root of the integer 0 to 10:
/// d ##class(PHA.TEST.SQLFunction).Sort()ClassMethod Sort(){s a = 0while a < 11 {&sql(SELECT SQRT(:a) INTO :b)if SQLCODE '= 0 {w !,"Error code ",SQLCODE} else {w !,"The square root of ",a," = ",bs a = a + 1}}}DHC-APP>d ##class(PHA.TEST.SQLFunction).Sort()The square root of 0 = 0The square root of 1 = 1The square root of 2 = 1.414213562373095049The square root of 3 = 1.732050807568877294The square root of 4 = 2The square root of 5 = 2.236067977499789697The square root of 6 = 2.449489742783178098The square root of 7 = 2.645751311064590591The square root of 8 = 2.828427124746190098The square root of 9 = 3The square root of 10 = 3.162277660168379332边栏推荐
- 实现集中式身份认证管理的案例
- CAN通信的数据帧和远程帧
- STM32 CAN filter configuration details
- 新一代超安全蜂窝电池, 思皓爱跑上市13.99万元起售
- 将同级数据处理成树形数据
- 找出相同属性值的对象 累加数量 汇总
- How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!
- 重庆市大力实施智能建造,推动建筑业数字化转型,助力“建造强市”
- Deep understanding of Istio - advanced practice of cloud native service mesh
- 安装apex报错
猜你喜欢

找出相同属性值的对象 累加数量 汇总

新一代超安全蜂窝电池, 思皓爱跑上市13.99万元起售

CloudCompare & PCL ICP registration (point to face)

Qt get all files in a folder

How to use DevExpress controls to draw flowcharts?After reading this article, you will understand!

达梦更换正式授权dm.key

The CAN communication standard frame and extended frame is introduced

CAN通信的数据帧和远程帧

新书上市 |《谁在掷骰子?》在“不确定性时代”中确定前行

【StoneDB Class】入门第二课:StoneDB 整体架构解析
随机推荐
How to get the address of WeChat video account (link address of WeChat public account)
稀疏表示--学习笔记
pandas连接oracle数据库并拉取表中数据到dataframe中、筛选当前时间(sysdate)到一个小时之前的所有数据(筛选一个小时的范围数据)
STM32 CAN filter configuration details
将同级数据处理成树形数据
Audio and Video Technology Development Weekly | 256
Meshlab&Open3D SOR滤波
[Unity3D Plugin] AVPro Video Plugin Share "Video Player Plugin"
How to successfully pass the CKA exam?
[Nodejs] node的fs模块
bpmn-process-designer基础上进行自定义样式(工具、元素、菜单)
【StoneDB Class】入门第二课:StoneDB 整体架构解析
MMF的初步介绍:一个规范化的视觉-语言多模态任务框架
bat countdown code
测试发文
[Nodejs] fs module of node
Apex installation error
这项工作事关中小学生生命安全!五部门作出联合部署
数据湖 delta lake和spark版本对应关系
那些利用假期学习的职场人,后来都怎么样了?