id在数组中时的postgresql表达式

id在数组中时的postgresql表达式,sql,arrays,postgresql,Sql,Arrays,Postgresql,我有一个ID数组,例如: a = [13, 51, 99, 143, 225, 235, 873] 在数组中id所在的位置,获取记录的最有效方法是什么 我真的不想使用或例如其中id=13 | | 92,因为数组可能非常长。我试过这个: select * from authors where id <@ [11, 8, 51, 62, 7]; 从id使用any的作者中选择* select * from authors where id = any (array[11, 8, 51,

我有一个ID数组,例如:

a = [13, 51, 99, 143, 225, 235, 873]
在数组中id所在的位置,获取记录的最有效方法是什么

我真的不想使用
例如
其中id=13 | | 92
,因为数组可能非常长。我试过这个:

select * from authors where id <@ [11, 8, 51, 62, 7];
从id使用
any的作者中选择*

select * 
from authors 
where id = any (array[11, 8, 51, 62, 7]);