List:General Discussion« Previous MessageNext Message »
From:Olav Mørkrid Date:April 28 2008 12:19pm
Subject:get all my newest messages
View as plain text  
hello

i have a message table like this:

created datetime
sender int
recipient int
message text

to get all my messages i would do:

select * from message where sender = $MYID or recipient = $MYID

but how do i make a query that returns the rows of only the NEWEST
messages between myself and my contacts (regardless of who sent the
newest message)?

i tried using "group-wise maximum" mentioned in the mysql manual, but
can't figure it out. hope someone can help. thanks!
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