Last active
September 8, 2016 14:56
-
-
Save mr5z/bea1e96e0ddc7687e5c05183ecfea04f to your computer and use it in GitHub Desktop.
This file contains 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 u.firstName AS sender FROM users u | |
INNER JOIN messages m | |
ON m.senderId = u.id | |
WHERE m.status = 'pending' | |
AND m.recipientId = $userId | |
-- GROUP BY u.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need to merge the rows into one if the senderId is the same