Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays PostgreSQL选择不在另一个数组中的数组项_Arrays_Postgresql - Fatal编程技术网

Arrays PostgreSQL选择不在另一个数组中的数组项

Arrays PostgreSQL选择不在另一个数组中的数组项,arrays,postgresql,Arrays,Postgresql,具有两个整数数组列的PostgreSQL表,例如a=[1,2,3,4]和b=[1,2,3,4,5,6]。b中不在a中的项是5,6,因此作为查询结果,我需要一个数组[5,6] 如何在PostgreSQL中实现这一点?安装了intarray扩展后,只需选择a-b,cp即可。可能重复的请参见:intarray运算符如此简单。。。安装intarray扩展后,只需选择a-b即可

具有两个整数数组列的PostgreSQL表,例如
a=[1,2,3,4]
b=[1,2,3,4,5,6]
b
中不在
a
中的项是
5,6
,因此作为查询结果,我需要一个数组
[5,6]


如何在PostgreSQL中实现这一点?

安装了
intarray
扩展后,只需
选择a-b
,cp即可。

可能重复的请参见:intarray运算符如此简单。。。安装intarray扩展后,只需选择a-b即可