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

INSERT INTO Table & Union Query

Status
Not open for further replies.

eerich

IS-IT--Management
Nov 2, 2003
124
US
Hello everyone,

I'm running into problems when trying to append to a table using the following union query. Any help is appreciated:

Code:
Select * INTO AU4

FROM
(SELECT Profile, Text, Status
FROM UPR)

UNION

(SELECT Profile, Text, Status
FROM UPR2);
 
Actually figured this out:

Code:
SELECT * INTO AU4
FROM
(SELECT Profile, Text, Status
FROM UPR

UNION

SELECT Profile, Text, Status
FROM UPR2);
 
Oops...maybe not...still can't use INSERT INTO existing table. Any tips on getting it to work with an existing table?
 
Try
Code:
INSERT INTO SomeTable (Profile, Text, Status)

SELECT Profile, Text, Status
FROM
(SELECT Profile, Text, Status FROM UPR

UNION

SELECT Profile, Text, Status FROM UPR2);
 
Golom,

That worked beautifully.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top