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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

selecting records from two tables

Status
Not open for further replies.

junkmail

Programmer
Jan 7, 2001
134
US
I have two tables each having fields a,b,c. What I want to do is select all the records from both tables into one view so if table a has 5 records and table be has 6 records I get a view containing 11 records with only 3 fields being display and not having a,b,c,a,b,c. Seems simple enough but i can't think how to get my result.
 
What's wrong with UNION ALL?
Code:
SELECT A, B, C
       FROM TableA
UNION ALL 
SELECT A, B, C
       FROM TableB


Borislav Borissov
VFP9 SP2, SQL Server 2000,2005 & 2008.
 
Nothing, that worked perfectly. I am fairly new to SQL. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top