Skip to content

Instantly share code, notes, and snippets.

@oleander
Created March 31, 2010 15:56
Show Gist options
  • Save oleander/350494 to your computer and use it in GitHub Desktop.
Save oleander/350494 to your computer and use it in GitHub Desktop.
SELECT SQL_NO_CACHE SQL_BIG_RESULT 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