hi lynn,
i tried this way, am i doing correct , please correct me, is the case statement logic is good? or do i need to check some otherway
please help me, it has to be run in optimized way,, so please suggest me i fi am doing anything wrong
select
sno,
name,
enroll,
(Case when noMail.enroldate IS NULL then 'N' else 'Y' + CAST( noMail.enrollDate as varchar(20) ) end) as PTCol,
(Case when Mail.enroldate IS NULL then 'N' else 'Y' + CAST( Mail.enrollDate as varchar(20) ) end) as DrillCol,
from dbo.student t left join dbo.studentPT noMail on t.sno = noMail.sno
left join dbo.studentDrill Mail on t.sno = Mail.sno