List:General Discussion« Previous MessageNext Message »
From:Olav Mørkrid Date:April 28 2008 5:10pm
Subject:Re: get all my newest messages
View as plain text  
Exactly.

2008/4/28, Martijn Tonies <m.tonies@stripped>:
>
> > >  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".
>
> So, a newest message from "me to A" would exclude the newest message
> from "A to me" (depending, of course, on the creation date)?
>
> Martijn Tonies
> Database Workbench - development tool for MySQL, and more!
> Upscene Productions
> http://www.upscene.com
> My thoughts:
> http://blog.upscene.com/martijn/
> Database development questions? Check the forum!
> http://www.databasedevelopmentforum.com
>
Thread
get all my newest messagesOlav Mørkrid28 Apr
  • Re: get all my newest messagesOlav Mørkrid28 Apr
  • Re: get all my newest messagesMartijn Tonies28 Apr
  • Re: get all my newest messagesMartijn Tonies28 Apr
    • Re: get all my newest messagesOlav Mørkrid28 Apr
  • Re: get all my newest messagesMartijn Tonies28 Apr
    • Re: get all my newest messagesOlav Mørkrid28 Apr
  • Re: get all my newest messagesMartijn Tonies28 Apr
    • Re: get all my newest messagesOlav Mørkrid28 Apr