Skip to content

Instantly share code, notes, and snippets.

@databraineo
Created August 16, 2019 08:21
Show Gist options
  • Save databraineo/3d8ec2b1ac4a3262162a9bd25205b238 to your computer and use it in GitHub Desktop.
Save databraineo/3d8ec2b1ac4a3262162a9bd25205b238 to your computer and use it in GitHub Desktop.
Code examples for SQL 1x1 blog-article - 15
SELECT
InvoiceId,
c.Name as Genre,
count(a.TrackId) AS AnzahlProKauf
FROM InvoiceLine a
INNER JOIN Track b on a.TrackId=b.TrackId
LEFT JOIN Genre c on b.GenreId=c.GenreId
GROUP BY InvoiceId, b.GenreId;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment