A LEFT JOIN should return all rows from the left table, with the matching rows in the right table. The result is NULL in the right side when there is no match. So how come my query below is not showing all rows from the left table?
Thank you!
SELECT
s.summitID,
s.name,
count( case when m.type = 'searchMarketing' then 1 else null end ) as 'searchMarketing',
count( case when m.type = 'accountMarketing' then 1 else null end ) as 'accountMarketing',
count( case when m.dateSent is not null then 1 else null end ) as 'totalSent',
count( case when m.dateClicked is not null then 1 else null end ) as 'totalClicked'
FROM
summits s
left JOIN
marketing m
ON
s.summitID = m.summitID
GROUP BY
m.summitID
ORDER BY
s.startDate desc
dod