当前位置:网站首页>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 7
The 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
边栏推荐
- Deep understanding of Istio - advanced practice of cloud native service mesh
- formatdatetime function mysql (date sub function)
- R language ggplot2 visualization: use the ggdensity function of the ggpubr package to visualize density plots, use the stat_central_tendency function to add mean vertical lines to the density and cust
- Qt获取文件夹下所有文件
- 2022 Go生态圈 rpc 框架 Benchmark
- Dameng replaces the officially authorized dm.key
- AI目标分割能力,无需绿幕即可实现快速视频抠图
- Aeraki Mesh became CNCF sandbox project
- (ES6以上以及TS) Map对象转数组
- 收藏|机械工程师面试常问问题
猜你喜欢
Favorites|Mechanical Engineer Interview Frequently Asked Questions
Sparse representation - study notes
A new generation of ultra-safe cellular batteries, Sihao Airun goes on sale starting at 139,900 yuan
Fault 007: The dexp derivative is inexplicably interrupted
阿里云官方 Redis 开发规范
Beyond Compare 4 trial period expires
[Open class preview]: Research and application of super-resolution technology in the field of video image quality enhancement
Programmer's self-cultivation
ECCV22|只能11%的参数就能优于Swin,微软提出快速预训练蒸馏方法TinyViT
STM32 CAN过滤器配置详解
随机推荐
[Community Star Selection] Issue 24 August Update Plan | Keep writing, refuse to lie down!More original incentive packages, as well as Huawei WATCH FIT watches!
2022 Go生态圈 rpc 框架 Benchmark
找出相同属性值的对象 累加数量 汇总
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
关于Request复用的那点破事儿。研究明白了,给你汇报一下。
Process sibling data into tree data
CloudCompare & PCL ICP registration (point to face)
程序员如何优雅地解决线上问题?
2022 Go ecosystem rpc framework Benchmark
表连接详解
leetcode/submatrix element sum
Tencent Cloud Native: Service Mesh Practice of Areaki Mesh in the 2022 Winter Olympics Video Live Application
通讯录(静态版)(C语言)(VS)
How to Integrate Your Service Registry with Istio?
The difference between undefined and null in JS
R语言两个时间序列数据的滞后相关性可视化:使用forecast包的ccf函数绘制交叉相关函数,根据可视化结果分析滞后相关性
安全又省钱,“15岁”老小区用上管道燃气
SCHEMA solves the puzzle
Feign 从注册到调用原理分析
重磅消息 | Authing 实现与西门子低代码平台的集成