Anda dapat menggunakan agregasi bersyarat:
select ad_id,
max(case when name = 'name' then valueofname end) as name,
max(case when name = 'age' then valueofname end) as age,
max(case when name = 'birthday' then valueofname end) as birthday,
max(case when name = 'job' then valueofname end) as job
from t
group by ad_id;
Di SQL Server, Anda juga dapat melakukan hal serupa dengan pivot
.