【发布时间】:2023-03-30 11:05:01
【问题描述】:
我只是想知道如何将整数列表存储为 PostreSQL 存储过程中的变量。
例如,我有这样的陈述:
select A from B where C IN (1,2,3);
select A from B where C IN (1,2);
我想声明一个变量来存储(1,2,3) 或(1,2)。
所以我最终会得到这样的声明:
select A from B where C in numberList;
(numberList 的值为 (1,2,3))
我不知道应该使用哪种数据类型,我在网上查了一下,在psql中找不到列表类型。那它的语法是什么?
【问题讨论】:
标签: postgresql