Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Combining Tables

Author  Topic 

mosiki
Starting Member

12 Posts

Posted - 2013-06-21 : 06:36:51
Hi

I have two tables with the exact same layout (column wise), and would like to show all data from two tables as one result set.

Table A has 581 Rows
Table B has 80 Rows

I need the result set to show selected columns with all 661 rows of data. there are no primary keys in any of the two tables. Number of columns and column names are exactly the same.

Many Thanks

Mosiki.

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-21 : 06:41:17
SELECT Column-list FROM Table1
UNION ALL
SELECT Column-list FROM Table2


--
Chandu
Go to Top of Page

bandi
Master Smack Fu Yak Hacker

2242 Posts

Posted - 2013-06-21 : 06:41:48
SELECT Column-list FROM Table1
UNION ALL
SELECT Column-list FROM Table2


--
Chandu
Go to Top of Page
   

- Advertisement -