Skip to content

Instantly share code, notes, and snippets.

@mr5z
Last active September 8, 2016 14:56
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 mr5z/bea1e96e0ddc7687e5c05183ecfea04f to your computer and use it in GitHub Desktop.
Save mr5z/bea1e96e0ddc7687e5c05183ecfea04f to your computer and use it in GitHub Desktop.
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
@mr5z
Copy link
Author

mr5z commented Sep 8, 2016

I need to merge the rows into one if the senderId is the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment