I have two tables.
One of them called "conversations" has the following data.
ConversationID Sender Reciever
1 bla1 bla2
2 bla1 bla3
3 bla1 bla4
The other is called "Messages" has the following data.
MessageID MessageText TimeAddedMessage ConversationID
1 helo 2012-03-12 13:00:00 2
2 helo 2012-03-12 13:01:00 1
3 helo 2012-03-12 13:02:00 3
4 helo 2012-03-12 13:03:00 3
5 helo 2012-03-12 13:04:00 2
The result i want from the query is the following:
5 helo 2012-03-12 13:04:00 2
4 helo 2012-03-12 13:03:00 3
2 helo 2012-03-12 13:01:00 1
Which means that we need the most recent comment for each conversation (sorted DESC by time).
Any help appreciated.