字串切割STRING_TO_ARRAY
UNNEST獲取一個ARRAY,然後平鋪成一個表,表中的每一行都是該ARRAY中的元素。
-- 查詢id是1 2 13 14的學生資訊 select * from student where student_id in (select num from unnest (string_to_array('1,2,13,14',',')) as num) -- 金倉unnset函式 select unnest('{1,2,3,4}'::int[]), 1 as test