解决此问题的一种方法是条件聚合:
select min(ID), SIN, max(case when type = 'phone' then contact end) as phone, max(case when type = 'email' then contact end) as emailfrom people tgroup by sin;

解决此问题的一种方法是条件聚合:
select min(ID), SIN, max(case when type = 'phone' then contact end) as phone, max(case when type = 'email' then contact end) as emailfrom people tgroup by sin;