Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MySQL-Pivot-Tabelle

Sie könnten (ungetestet) so etwas wie

versuchen
select form_id, 
max(case data_label when 'lastName' then data_value else null end) as lastname, 
max(case data_label when 'firstName' then data_value else null end) as firstname,
max(case data_label when 'phone' then data_value else null end) as phone
from mytable 
group by form_id