SELECT Acct_num , Acct_type,
MAX(CASE WHEN Alt_id_type = 'C_id' THEN Alt_id END) AS C_id,
MAX(CASE WHEN Alt_id_type = 'D_id' THEN Alt_id END) AS D_id,
MAX(CASE WHEN Alt_id_type = 'E_id' THEN Alt_id END) AS E_id
FROM Alt_tbl
GROUP BY Acct_num, Acct_type
↧