我有一个动态列表。
list=['a','b','c','d' ..... ]
,因此长度可能会改变
我想在查询中比较这些列表值
select * from student where name in(all the list values);
我想将列表值传递给该查询
我该怎么做.. ???请帮忙 谢谢
答案 0 :(得分:0)
在Postgres中,您可以使用数组。 where
子句中的语法如下:
where name = any (array[1, 2, 3])
或
where name = any (list_parameter)