操作符 | 描述 | 例子 | 结果 |
---|---|---|---|
= | 等于 | ARRAY[1.1,2.1,3.1]::int[] = ARRAY[1,2,3] | t |
<> | 不等于 | ARRAY[1,2,3] <> ARRAY[1,2,4] | t |
< | 小于 | ARRAY[1,2,3] < ARRAY[1,2,4] | t |
> | 大于 | ARRAY[1,4,3] > ARRAY[1,2,4] | t |
<= | 小于等于 | ARRAY[1,2,3] <= ARRAY[1,2,3] | t |
>= | 大于等于 | ARRAY[1,4,3] >= ARRAY[1,4,3] | t |
@> | 包含 | ARRAY[1,4,3] @> ARRAY[3,1] | t |
<@ | 被包含 | ARRAY[2,7] <@ ARRAY[1,7,4,2,6] | t |
&& | 重叠(具有公共元素) | ARRAY[1,4,3] && ARRAY[2,1] | t |
|| | 数组和数组串接 | ARRAY[1,2,3] || ARRAY[4,5,6] | {1,2,3,4,5,6} |
|| | 数组和数组串接 | ARRAY[1,2,3] || ARRAY[[4,5,6],[7,8,9]] | {{1,2,3},{4,5,6},{7,8,9}} |
|| | 元素到数组串接 | 3 || ARRAY[4,5,6] | {3,4,5,6} |
|| | 数组到元素串接 | ARRAY[4,5,6] || 7 | {4,5,6,7} |
本文出自 “简单可依赖” 博客,请务必保留此出处http://wenxuehui.blog.51cto.com/12898974/1954880
原文地址:http://wenxuehui.blog.51cto.com/12898974/1954880