Skip to content
Archive of posts tagged LEFT JOIN

Join Types

Describes the different kinds of joins used in SQL Server.

GROUP BY with LEFT JOIN

Simple GROUP BY with LEFT JOIN example:

SELECT
el.LogPortalName
,con.LogTypeFriendlyName
,COUNT(1)
FROM dbo.EventLog el
LEFT JOIN dbo.EventLogTypes con
ON con.LogTypeKey = el.LogTypeKey
GROUP BY el.LogPortalName, con.LogTypeFriendlyName