user2341693
user2341693

Reputation: 132

Query writing based on output format

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

Answers (1)

dArc
dArc

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

Related Questions