Created
May 28, 2014 13:31
-
-
Save marshallm/b85b5872aa7a541dcdf1 to your computer and use it in GitHub Desktop.
SQL Format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT message_id AS id, | |
| subject, | |
| is_read, | |
| Date_format(sentDate, '%m/%d/%y') AS ts, | |
| messagetypeid AS type | |
| FROM ( | |
| SELECT message_id, | |
| is_read | |
| FROM message_user mu | |
| WHERE user_id = 3784 | |
| AND label = 'Sent' | |
| ORDER BY is_read ASC,id DESC | |
| LIMIT 10 | |
| ) o | |
| JOIN message ON (message.messageId = o.message_id); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment