Let's say we have a table as shown below:
Band |name |age
---------------------------
1 abc 18
1 xyz 20
2 aaa 18
2 bbb 19
3 ccc 22
4 ddd 28
Expected output:
Band |name |age |new_col
------------------------------
1 abc 18 [aaa, bbb, ccc, ddd]
1 xyz 20 [aaa, bbb, ccc, ddd]
2 aaa 18 [ccc, ddd]
2 bbb 19 [ccc, ddd]
3 ccc 22 [ddd]
4 ddd 28 [null]
Here based on the band, we need to get the new_col. Thank U