Skip to content

Instantly share code, notes, and snippets.

@oleander
Created March 24, 2010 17:39
Show Gist options
  • Save oleander/342533 to your computer and use it in GitHub Desktop.
Save oleander/342533 to your computer and use it in GitHub Desktop.
SELECT MAX(`ChannelsSong`.`time`) as last, `Channel`.`name`, `ChannelsSong`.`id` FROM `channels_songs` AS `ChannelsSong` LEFT JOIN `channels` AS `Channel` ON (`ChannelsSong`.`channel_id` = `Channel`.`id`) WHERE 1 = 1 GROUP BY `ChannelsSong`.`channel_id` ORDER BY last DESC
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment