Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
What is wrong with this:
(SELECT * from wot_head order by date desc) UNION (SELECT * from wo_head order by date desc)
It returns the right result but they are NOT ordered by the column date.
Both tables have identical columns, both have a column named date
8/22/2022 - Mon
I don't see that you are ordering the complete results, just the two different ones that you are JOINing. Maybe try..
(SELECT * from wot_head) UNION (SELECT * from wo_head ) ORDER BY date desc
There is an order by clause after BOTH selects. It's not capitalized, does that matter?
Or is MySQL confused because there are two date columns? Do I have to specify which date field in which table (ie, order by wot_head.date)?
Oh maybe I have to put the order by AFTER the UNION business?
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
What Dave said...
SELECT * from wot_head
SELECT * from wo_head
order by date desc
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent