人大金倉切割逗號拼接的字符串,并使用in來查詢
字符串切割STRING_TO_ARRAY
UNNEST獲取一個ARRAY,然后平鋪成一個表,表中的每一行都是該ARRAY中的元素。
-- 查詢id是1 2 13 14的學(xué)生信息 select * from student where student_id in (select num from unnest (string_to_array('1,2,13,14',',')) as num) -- 金倉unnset函數(shù) select unnest('{1,2,3,4}'::int[]), 1 as test

浙公網(wǎng)安備 33010602011771號