Create view LProva as
(
Select distinct c.[cust.id], a.sms, b.email from
(Select [cust.id], [cust.contactemail] sms from Prova where [cust.contacttype] = 'sms' ) a,
(Select [cust.id], [cust.contactemail] email from Prova where [cust.contacttype] = 'email'...