Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id cluster_array
- 1 [1,2]
- 2 [2,3]
- 3 [4]
- [1,2] [1,2,2,3]
- [3] [4]
- with t as (select unnest(array[1,1,2,2,3]) id, unnest(array[1,2,2,3,4]) clst)
- select id, array_agg(clst) from t group by id order by id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement