Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to write mutiple table query 1

Status
Not open for further replies.

bakerm

Programmer
Apr 25, 2000
53
US
I need a query that will look at several different tables to obtain needed records.

ex. Select field from table where field < 0

I need to incorporate seven different tables into this one query. All the tables have the field needed named the same.

I then need a distinct list of these field values so no duplicates will be returned.

Any help will be greatly appreciated.

Mark
 
If I understand the question, you can use a UNION statement as in:

SELECT field
FROM table1
WHERE field < 0

UNION

SELECT field
FROM table2
WHERE field < 0

... etc. etc.

UNION will remove duplicated from the result set...

Tom
 
Did just what I needed.

Thanks Tom!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top