### [PostgreSQL学习手册(函数和操作符<一>)](http://www.cnblogs.com/stephen-liu74/archive/2012/05/02/2294071.html)
Posted on 2012-05-02 07:43 [Stephen_Liu](http://www.cnblogs.com/stephen-liu74/) 阅读(1689) 评论(0) [编辑](http://www.cnblogs.com/stephen-liu74/admin/EditPosts.aspx?postid=2294071) [收藏](http://www.cnblogs.com/stephen-liu74/archive/2012/05/02/2294071.html#) ![](https://box.kancloud.cn/2015-10-30_5632e1b6d6c20.jpg)
**一、逻辑操作符:**
常用的逻辑操作符有:**AND**、**OR**和**NOT**。其语义与其它编程语言中的逻辑操作符完全相同。
**二、比较操作符:**
下面是PostgreSQL中提供的比较操作符列表:**
**
| **操作符** | **描述** |
|-----|-----|
| < | 小于 |
| > | 大于 |
| <= | 小于或等于 |
| >= | 大于或等于 |
| = | 等于 |
| != | 不等于 |
**** 比较操作符可以用于所有可以比较的数据类型。所有比较操作符都是双目操作符,且返回boolean类型。除了比较操作符以外,我们还可以使用BETWEEN语句,如:
a **BETWEEN** x **AND** y 等效于 a >= x **AND** a <= y
a **NOT BETWEEN** x **AND** y 等效于 a < x **OR** a > y
**三、 数学函数和操作符:**
下面是PostgreSQL中提供的数学操作符列表:
| **操作符** | **描述** | **例子** | **结果** |
|-----|-----|-----|-----|
| + | 加 | 2 + 3 | 5 |
| - | 减 | 2 - 3 | -1 |
| * | 乘 | 2 * 3 | 6 |
| / | 除 | 4 / 2 | 2 |
| % | 模 | 5 % 4 | 1 |
| ^ | 幂 | 2.0 ^ 3.0 | 8 |
| |/ | 平方根 | |/ 25.0 | 5 |
| ||/ | 立方根 | ||/ 27.0 | 3 |
| ! | 阶乘 | 5 ! | 120 |
| !! | 阶乘 | !! 5 | 120 |
| @ | 绝对值 | @ -5.0 | 5 |
| & | 按位AND | 91 & 15 | 11 |
| | | 按位OR | 32 | 3 | 35 |
| # | 按位XOR | 17 # 5 | 20 |
| ~ | 按位NOT | ~1 | -2 |
| << | 按位左移 | 1 << 4 | 16 |
| >> | 按位右移 | 8 >> 2 | 2 |
按位操作符只能用于整数类型,而其它的操作符可以用于全部数值数据类型。按位操作符还可以用于位串类型bit和bit varying,
下面是PostgreSQL中提供的数学函数列表,需要说明的是,这些函数中有许多都存在多种形式,区别只是参数类型不同。除非特别指明,任何特定形式的函数都返回和它的参数相同的数据类型。
<table style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; MARGIN: 0px auto; WIDTH: 650px; BORDER-COLLAPSE: collapse; HEIGHT: 573px; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; border-image: initial" border="0" align="center"><tbody><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; TEXT-ALIGN: center; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="FONT-SIZE: 13px"><strong><span style="COLOR: rgb(0,0,255)">函数</span></strong></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; TEXT-ALIGN: center; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="FONT-SIZE: 13px"><strong><span style="COLOR: rgb(0,0,255)">返回类型<br/></span></strong></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; TEXT-ALIGN: center; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="FONT-SIZE: 13px"><strong><span style="COLOR: rgb(0,0,255)">描述</span></strong></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; TEXT-ALIGN: center; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="FONT-SIZE: 13px"><strong><span style="COLOR: rgb(0,0,255)">例子<span class="Apple-converted-space"> </span><br/></span></strong></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; TEXT-ALIGN: center; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="FONT-SIZE: 13px"><strong><span style="COLOR: rgb(0,0,255)">结果</span></strong></span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">abs(x)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">绝对值</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">abs(-17.4)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">17.4</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">cbrt(double)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">立方根</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">cbrt(27.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">3</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">ceil(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">不小于参数的最小的整数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">ceil(-42.8)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">-42</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">degrees(double)<span class="Apple-converted-space"> </span><br/></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">把弧度转为角度</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">degrees(0.5)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">28.6478897565412</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">exp(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">自然指数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">exp(1.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">2.71828182845905</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">floor(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">不大于参数的最大整数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">floor(-42.8)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">-43</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">ln(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">自然对数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">ln(2.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">0.693147180559945</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">log(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">10为底的对数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">log(100.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">2</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">log(b numeric,x numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">numeric指定底数的对数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">log(2.0, 64.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">6.0000000000</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">mod(y, x)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">取余数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">mod(9,4)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">1</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">pi()<span class="Apple-converted-space"> </span><br/></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">double</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">"π"常量</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">pi()<span class="Apple-converted-space"> </span><br/></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">3.14159265358979</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">power(a double, b double)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">double</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">求a的b次幂</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">power(9.0, 3.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">729</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">power(a numeric, b numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">numeric</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">求a的b次幂</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">power(9.0, 3.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">729</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">radians(double)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">double</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">把角度转为弧度</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">radians(45.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">0.785398163397448</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">random()</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">double</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">0.0到1.0之间的随机数值</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">random()</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">round(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">圆整为最接近的整数</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">round(42.4)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">42</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">round(v numeric, s int)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">numeric</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">圆整为s位小数数字</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">round(42.438,2)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">42.44</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">sign(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">参数的符号(-1,0,+1)<span class="Apple-converted-space"> </span><br/></span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">sign(-8.4)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">-1</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">sqrt(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">平方根</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">sqrt(2.0)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">1.4142135623731</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">trunc(double/numeric)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"> </td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">截断(向零靠近)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">trunc(42.8)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">42</span></td></tr><tr><td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">trunc(v numeric, s int)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">numeric</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">截断为s小数位置的数字</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">trunc(42.438,2)</span></td> <td style="BORDER-BOTTOM: rgb(192,192,192) 1px solid; BORDER-LEFT: rgb(192,192,192) 1px solid; PADDING-BOTTOM: 3px; PADDING-LEFT: 3px; PADDING-RIGHT: 3px; BORDER-COLLAPSE: collapse; FONT-SIZE: 12px; WORD-BREAK: normal !important; BORDER-TOP: rgb(192,192,192) 1px solid; BORDER-RIGHT: rgb(192,192,192) 1px solid; PADDING-TOP: 3px; border-image: initial"><span style="COLOR: rgb(0,0,255); FONT-SIZE: 13px">42.43</span></td></tr></tbody></table>
** **三角函数列表:
| **函数** | **描述** |
|-----|-----|
| acos(x) | 反余弦 |
| asin(x) | 反正弦 |
| atan(x) | 反正切 |
| atan2(x, y) | 正切 y/x 的反函数 |
| cos(x) | 余弦 |
| cot(x) | 余切 |
| sin(x) | 正弦 |
| tan(x) | 正切 |
**四、字符串函数和操作符:**
下面是PostgreSQL中提供的字符串操作符列表:
| **函数** | **返回类型** | **描述** | **例子** | **结果** |
|-----|-----|-----|-----|-----|
| string || string | text | 字串连接 | 'Post' || 'greSQL' | PostgreSQL |
| bit_length(string) | int | 字串里二进制位的个数 | bit_length('jose') | 32 |
| char_length(string) | int | 字串中的字符个数 | char_length('jose') | 4 |
| convert(string using conversion_name) | text | 使用指定的转换名字改变编码。 | convert('PostgreSQL' using iso_8859_1_to_utf8) | 'PostgreSQL' |
| lower(string) | text | 把字串转化为小写 | lower('TOM') | tom |
| octet_length(string) | int | 字串中的字节数 | octet_length('jose') | 4 |
| overlay(string placing string from int [for int]) | text | 替换子字串 | overlay('Txxxxas' placing 'hom' from 2 for 4) | Thomas |
| position(substring in string) | int | 指定的子字串的位置 | position('om' in 'Thomas') | 3 |
| substring(string [from int] [for int]) | text | 抽取子字串 | substring('Thomas' from 2 for 3) | hom |
| substring(string from pattern) | text | 抽取匹配 POSIX 正则表达式的子字串 | substring('Thomas' from '...$') | mas |
| substring(string from pattern for escape) | text | 抽取匹配SQL正则表达式的子字串 | substring('Thomas' from '%#"o_a#"_' for '#') | oma |
| trim([leading | trailing | both] [characters] from string) | text | 从字串string的开头/结尾/两边/ 删除只包含characters(缺省是一个空白)的最长的字串 | trim(both 'x' from 'xTomxx') | Tom |
| upper(string) | text | 把字串转化为大写。 | upper('tom') | TOM |
| ascii(text) | int | 参数第一个字符的ASCII码 | ascii('x') | 120 |
| btrim(string text [, characters text]) | text | 从string开头和结尾删除只包含在characters里(缺省是空白)的字符的最长字串 | btrim('xyxtrimyyx','xy') | trim |
| chr(int) | text | 给出ASCII码的字符 | chr(65) | A |
| convert(string text, [src_encoding name,] dest_encoding name) | text | 把字串转换为dest_encoding | convert( 'text_in_utf8', 'UTF8', 'LATIN1') | 以ISO 8859-1编码表示的text_in_utf8 |
| initcap(text) | text | 把每个单词的第一个子母转为大写,其它的保留小写。单词是一系列字母数字组成的字符,用非字母数字分隔。 | initcap('hi thomas') | Hi Thomas |
| length(string text) | int | string中字符的数目 | length('jose') | 4 |
| lpad(string text, length int [, fill text]) | text | 通过填充字符fill(缺省时为空白),把string填充为长度length。 如果string已经比length长则将其截断(在右边)。 | lpad('hi', 5, 'xy') | xyxhi |
| ltrim(string text [, characters text]) | text | 从字串string的开头删除只包含characters(缺省是一个空白)的最长的字串。 | ltrim('zzzytrim','xyz') | trim |
| md5(string text) | text | 计算给出string的MD5散列,以十六进制返回结果。 | md5('abc') | |
| repeat(string text, number int) | text | 重复string number次。 | repeat('Pg', 4) | PgPgPgPg |
| replace(string text, from text, to text) | text | 把字串string里出现地所有子字串from替换成子字串to。 | replace('abcdefabcdef', 'cd', 'XX') | abXXefabXXef |
| rpad(string text, length int [, fill text]) | text | 通过填充字符fill(缺省时为空白),把string填充为长度length。如果string已经比length长则将其截断。 | rpad('hi', 5, 'xy') | hixyx |
| rtrim(string text [, character text]) | text | 从字串string的结尾删除只包含character(缺省是个空白)的最长的字 | rtrim('trimxxxx','x') | trim |
| split_part(string text, delimiter text, field int) | text | 根据delimiter分隔string返回生成的第field个子字串(1 Base)。 | split_part('abc~@~def~@~ghi', '~@~', 2) | def |
| strpos(string, substring) | text | 声明的子字串的位置。 | strpos('high','ig') | 2 |
| substr(string, from [, count]) | text | 抽取子字串。 | substr('alphabet', 3, 2) | ph |
| to_ascii(text [, encoding]) | text | 把text从其它编码转换为ASCII。 | to_ascii('Karel') | Karel |
| to_hex(number int/bigint) | text | 把number转换成其对应地十六进制表现形式。 | to_hex(9223372036854775807) | 7fffffffffffffff |
| translate(string text, from text, to text) | text | 把在string中包含的任何匹配from中的字符的字符转化为对应的在to中的字符。 | translate('12345', '14', 'ax') | a23x5 |
**五、位串函数和操作符:**
对于类型bit和bit varying,除了常用的比较操作符之外,还可以使用以下列表中由PostgreSQL提供的位串函数和操作符,其中&、|和#的位串操作数必须等长。在移位的时候,保留原始的位串的的长度。
| **操作符** | **描述** | **例子** | **结果** |
|-----|-----|-----|-----|
| || | 连接 | B'10001' || B'011' | 10001011 |
| & | 按位AND | B'10001' & B'01101' | 00001 |
| | | 按位OR | B'10001' | B'01101' | 11101 |
| # | 按位XOR | B'10001' # B'01101' | 11100 |
| ~ | 按位NOT | ~ B'10001' | 01110 |
| << | 按位左移 | B'10001' << 3 | 01000 |
| >> | 按位右移 | B'10001' >> 2 | 00100 |
除了以上列表中提及的操作符之外,位串还可以使用字符串函数:length, bit_length, octet_length, position, substring。此外,我们还可以在整数和bit之间来回转换,如:
* MyTest=# SELECT 44::bit(10);*
bit
------------
0000101100
(1 row)
* MyTest=# SELECT 44::bit(3);*
bit
-----
100
(1 row)
*MyTest=# SELECT cast(-44 as bit(12));*
bit
--------------
111111010100
(1 row)
*MyTest=# SELECT '1110'::bit(4)::integer;*
int4
------
14
(1 row)
注意:如果只是转换为"bit",意思是转换成bit(1),因此只会转换成整数的最低位。
*该博客中提供的所有信息均源自PostgreSQL官方文档,编写该篇博客的主要目的是便于今后的查阅,特此声明。*
分类: [PostgreSQL](http://www.cnblogs.com/stephen-liu74/category/343171.html)
- 数据表
- 模式Schema
- 表的继承和分区
- 常用数据类型
- 函数和操作符-一
- 函数和操作符-二
- 函数和操作符-三
- 索引
- 事物隔离
- 性能提升技巧
- 服务器配置
- 角色和权限
- 数据库管理
- 数据库维护
- 系统表
- 系统视图
- SQL语言函数
- PL-pgSQL过程语言
- PostgreSQL 序列(SEQUENCE)
- PostgreSQL的时间-日期函数使用
- PostgreSQL 查看数据库,索引,表,表空间大小
- 用以查询某表的详细 包含表字段的注释信息
- PostgreSQL 系统表查看系统信息
- postgre存储过程简单实用方法
- PostgreSQL实用日常维护SQL
- PostgreSQL的时间函数使用整理
- 命令
- pg_ctl控制服务器
- initdb 初始化数据库簇
- createdb创建数据库
- dropdb 删除数据库
- createuser创建用户
- dropuser 删除用户
- psql交互式工具
- psql命令手册
- pg_dump 数据库转储
- pg_restore恢复数据库
- vacuumdb 清理优化数据库
- reindexdb 数据库重创索引
- createlang 安装过程语言
- droplang 删除过程语言
- pg_upgrade 升级数据库簇
- 调试存储过程
- 客户端命令-一
- 客户端命令-二
- 使用技巧
- PostgreSQL删除重复数据
- postgresql 小技巧
- PostgreSQL的10进制与16进制互转
- PostgreSQL的汉字转拼音
- Postgres重复数据的更新一例
- PostgreSQL使用with一例
- PostgreSQL在函数内返回returning
- PostgreSQL中的group_concat使用
- PostgreSQL数据库切割和组合字段函数
- postgresql重复数据的删除
- PostgreSQL的递归查询(with recursive)
- PostgreSQL函数如何返回数据集
- PostgreSQL分区表(Table Partitioning)应用 - David_Tang - 博客园
- PostgreSQL: function 返回结果集多列和单列的例子
- 利用pgAgent创建定时任务
- 浅谈 PostgreSQL 类型转换类似Oracle
- postgresql在windows(包括win7)下的安装配置
- PostgreSQL简介、安装、用户管理、启动关闭、创建删除数据库 (2010-11-08 12-52-51)转载▼标签: 杂谈分类: PostgreSQL
- PostgreSQL的generate_series函数应用
- PostgreSQL 8.3.1 全文检索(Full Text Search)
- postgresql record 使用
- 备份恢复
- PostgreSQL基于时间点恢复(PITR)
- Postgresql基于时间点恢复PITR案例(二)
- Postgres逻辑备份脚本
- Postgres invalid command \N数据恢复处理