Skip to content

Instantly share code, notes, and snippets.

@oleander
Created May 5, 2010 19:11
Show Gist options
  • Save oleander/391279 to your computer and use it in GitHub Desktop.
Save oleander/391279 to your computer and use it in GitHub Desktop.
SELECT *
FROM `channels`
LEFT OUTER JOIN `gigs` ON `gigs`.`channel_id` = `channels`.`id`
LEFT OUTER JOIN `songs` ON `songs`.`id` = `gigs`.`song_id`
GROUP BY channels.id ORDER BY channels.id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment