Skip to content
Advertisement

Row as column in mysql without using function

I am wodering is it possible to use a pivot table to make the col as rows without using any mysql functions and GROUP AS.

Here’s the table

Here’s the desired output iam looking for. The header is the id

Advertisement

Answer

This is painful, but you can do:

Note that this only works for the data that you have provided. If you have additional columns or rows, you would need to modify the query.

Here is a db<>fiddle.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement