tags:

views:

286

answers:

2

Is this possible? Using SQL Server 2005.......

SELECT *
FROM Data0304 
UNION 
SELECT *
FROM Data0506
UNION 
SELECT *
FROM Data0708
+5  A: 

As long as the columns are the same in all three tables, but you might want to use UNION ALL to ensure duplicates are included.

Nissan Fan
And should specify the column names rather than using `*`.
RedFilter
+1  A: 

When you say

columns are same

that means,

number of columns and data types and their lengths and their order

should be same.

UNION

will include duplicate records only once in the result and

UNION ALL

will include all the duplicate records.

RaviG