• + 0 comments

    select Doctor, Professor,Singer,Actor from (select occupation,name, dense_rank() over(partition by occupation order by name ) as rnk from occupations) pivot (max(name) for occupation in ('Doctor' as Doctor,'Professor' as Professor ,'Singer' as Singer ,'Actor' as Actor )) order by rnk ;