Need to group records from following below sample input data on based on state,card number,card type, origin, method of payment, sales amount so that all records belonging to same group will be present in single row.
I tried using list aggregate but on larger data set it is not working as expected.
state | card number | card type | origin | mop | sales amount |
---|---|---|---|---|---|
ma | 123 | mastercard | outside | swipe | 800 |
ma | 456 | visa | inside | tap | 800 |
ca | 345 | amex | outside | swipe | 600 |
Output:
| state| card number |card type|origin|mop|sales amount
| ——– | ——– |——|——-|——–|——–|
|ma|123,456|mastercard,visa|outside,inside|swipe,tap|800|
|ca|345|amex|outside|swipe|600|
Tried using listagg but on large data set it is not working as expcted as grouping is based on multiple columns.