Hi,
I need to convert the following correlated subquery in Linq to Sql. I am able to achieve the left outer join part. However, grouping in a subquery is where i am getting incorrect results.
SELECT
ae.Id,ae.Title
,(select COUNT(*) from [dbo].[AssociationEventRSVP] where RSVPStatus='Y'
group by AssociationEventId, RSVPStatus having RSVPStatus='Y'
and AssociationEventId=ar.AssociationEventId) as CountYes
,(select COUNT(*) from [dbo].[AssociationEventRSVP]
group by AssociationEventId, RSVPStatus having RSVPStatus='N'
and AssociationEventId=ar.AssociationEventId) as CountNo
FROM [dbo].[AssociationEvents] as ae
left outer join AssociationEventRSVP as ar
on ae.Id=ar.AssociationEventId
Thanks in advance for your help.
Tushar M.