MySQL Forums
Forum List  »  Newbie

Re: Getting all rows from 2 tables
Posted by: Sean Nolan
Date: April 18, 2005 04:06PM

Use a UNION, something like

SELECT ... FROM OnlineOrders
UNION
SELECT ... FROM OfflineOrders
ORDER BY ...

The columns in the select list must match up (same number of columns and each column must have a matching data type to the corresponding column in the other query). The ORDER BY applies to all rows from both queries - ie. it is applied to all the result rows.

Sean Nolan

Options: ReplyQuote


Subject
Written By
Posted
April 18, 2005 03:15AM
Re: Getting all rows from 2 tables
April 18, 2005 04:06PM


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.