Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. id cluster_array
  2. 1 [1,2]
  3. 2 [2,3]
  4. 3 [4]
  5.  
  6. [1,2] [1,2,2,3]
  7. [3] [4]
  8.  
  9. with t as (select unnest(array[1,1,2,2,3]) id, unnest(array[1,2,2,3,4]) clst)
  10. select id, array_agg(clst) from t group by id order by id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement