0
I would like a help from you because I could not do with the topics I found on the internet.
I have a "Chat" table with the following fields:
And I’m using the following select:
SELECT b.`id`, b.`Fullname`, b.`Photo`, a.`Message`
FROM `Chat` AS a
INNER JOIN `Users` AS b ON b.`id` = a.`SenderBy`
WHERE a.`ReceiverBy` = '2'
GROUP BY a.`SenderBy`
ORDER BY a.`CreateDate`
LIMIT 20
That returns me the following result:
Anyway, what I was having done: Select the last messages received by Senderby group in descending order.
Tries to change from
ORDER BY a.CreateDate
forORDER BY a.CreateDate DESC
– fajuchem
It didn’t work out like waiting for him either, it just changed that Lucas Soares came in first, which is wrong.
– Lucas Soares