panthro
panthro

Reputation: 24061

Selecting from two tables?

I have two tables, orders and old_orders.

Each table has some similar fields and some different fields.

I want to select name and id from both tables and output all of the orders from both tables.

Thanks

Upvotes: 0

Views: 91

Answers (1)

ain
ain

Reputation: 22749

I quess what you want is UNION, ie

SELECT name, id FROM orders WHERE ...
UNION
SELECT name, id FROM orders_old WHERE ...

Upvotes: 2

Related Questions