Reputation: 132
i need some assistance in writing a query that returns o/p in a specific format.Here are the data values. They need to be grouped based on their 3rd column and 2nd column.I need a query in such a way that for every unique combination of 2nd and 3rd column values the set of 1st column rows need to be output. But when i used group by the rows are missing.
Upvotes: 0
Views: 34
Reputation: 342
u can use this:
SELECT GROUP_CONCAT(Column1 SEPARATOR '-') AS Column1, Column2, Column3, Column5 FROM Table GROUP BY Column2, Column3, Column5;
Upvotes: 1