MySQL Forums
Forum List  »  General

Re: only_full_group_by Query Rewrite Assist
Posted by: Peter Brawley
Date: October 14, 2018 09:41AM

Is this what you mean?

select userid, max(created) as created
from (
  (select uid as userid, max(created) as created from message 
   where uid<>1234 group by userid order by created desc limit 5
  )
  union 
  (select puid as userid, max(created) as created from message 
   where puid<>1234 group by userid order by created desc limit 5
  )
) recent
group by userid
order by created desc limit 5;
[/code[

Options: ReplyQuote


Subject
Written By
Posted
Re: only_full_group_by Query Rewrite Assist
October 14, 2018 09:41AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.