I have this 'occupations' two-column table, holding the name and occupation of multiple persons. The occupations are known and can only be 'Developer', 'Engineer','Doctor','Musician'.
Name | Occupation
Dan | Developer
Martin | Doctor
Sam | Engineer
Andre | Musician
Tom | Engineer
The aim is to obtain something like the following:
Doctor | Engineer | Developer | Musician
Martin | Sam | Dan | Andre
NULL | Tom | NULL | NULL
All columns should be alphabetically ordered.
Do you guys have any suggestions regarding how I can this be achieved (without creating tables, views) using MySQL?
Thanks a lot!