Skip to content

Instantly share code, notes, and snippets.

@ngmaloney
Created December 8, 2010 17:23
Show Gist options
  • Save ngmaloney/733586 to your computer and use it in GitHub Desktop.
Save ngmaloney/733586 to your computer and use it in GitHub Desktop.
top comments by uid
select c.uid, c.cid, c.created
from (
select uid, max(created) as maxcreated
from comment group by uid
) as x inner join comment as c on c.uid = x.uid and c.created = x.maxcreated
order by maxcreated desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment