Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

one query and one result set

select * from a_messages where profile_id='username' order by message_id desc
select * from a_messages2 where profile_id='username' order by message_id desc


want one query with one result set because tables have same structure
Avatar of plusone3055
plusone3055
Flag of United States of America image

select * from a_messages where profile_id='username' order by message_id desc
UNION
select * from a_messages2 where profile_id='username' order by message_id desc
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
#@(*&Q#(*(&$ ANGELLLL!!!!!!

LOL

one misype :(
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i know its a monday I wasn't quite awake yet and i dont drink coffee
  :)
Avatar of rgb192

ASKER

https://www.experts-exchange.com/M_4365474.html

Error Code: 1221. Incorrect usage of UNION and ORDER BY


second query worked

thanks for explanations also