Hi

I have the following case statement, but I am not getting the desired results. I would like the results to return a single row for each fname, lname, email with 'Y' or 'N' values for the WEBCAST_1...4.

Right now I get multiple rows where fname, lname, email has different value for WEBCAST_1, 2, 3 and 4.


How can I group it so one row will show wether fname, lname, email attended more than one WEBCAST?



SELECT distinct fname, lname, email,

(CASE when web_cast_id = 1 then 'Y' else 'N' end) WEBCAST_1,
(CASE when web_cast_id = 2 then 'Y' else 'N' end) WEBCAST_2,
(CASE when web_cast_id = 3 then 'Y' else 'N' end) WEBCAST_3,
(CASE when web_cast_id = 4 then 'Y' else 'N' end) WEBCAST_4

FROM marketing_leads.web_cast


Thank You