Re: get all my newest messages
- Date: Mon, 28 Apr 2008 15:54:50 +0200
- From: "Olav Mørkrid" <olav.morkrid@xxxxxxxxx>
- Subject: Re: get all my newest messages
On 28/04/2008, Martijn Tonies <m.tonies@xxxxxxxxxxx> wrote:
> select *
> from ( select * from msgs order by msgs.created desc ) t
> where sender = 1 or recipient = 1
> group by sender, recipient
not quite right. first comes all of MY newest messages, then comes all
of THEIR newest messages. for example:
S R
1 2
1 3
1 5
1 7
2 1
5 1
the final result should include EITHER "1 2" OR "2 1", depending on
which of the two is newest. same for "1 5" and "5 1".
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=royale@xxxxxxxxxx