Skip to content

Instantly share code, notes, and snippets.

@mlangenberg
Created October 11, 2013 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mlangenberg/6940231 to your computer and use it in GitHub Desktop.
Save mlangenberg/6940231 to your computer and use it in GitHub Desktop.
SELECT `messages`.* FROM `messages`
INNER JOIN `message_recipients` ON `messages`.id = `message_recipients`.message_id
WHERE `message_recipients`.recipient_id = X
ORDER BY messages.created_at DESC LIMIT 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment