• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 10129
  • Last Modified:

SQL Server 2005: SELECT INTO new TABLE two SELECT statements UNION'ed?

I'm looking to import two select statements union'ed together that is using a distinct to get unique records:

select * into cpv2649 from
select distinct keyword from
(select keyword from bcastcpv
union
select keyword from lfmain1) as list

But it gives me an error.  Any ideas on what I can do to acomplish this?

Thanks,
Joe
0
adworldmedia
Asked:
adworldmedia
1 Solution
 
Chris MangusDatabase AdministratorCommented:
select *
into cpv2649
from (
select distinct keyword from
(select keyword from bcastcpv
union
select keyword from lfmain1) B) A
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now