April 21, 2006 at 12:48 pm
Hello,
I have UNIONed three SELECT statements, and I need to take the results, and put them into a temp table. The SELECTs look something like this;
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
Can I use SELECT INTO to take all of this and put it into a temp table?
Thanks!
CSDunn
April 21, 2006 at 12:51 pm
Just wrap it with a select.
select * into table_Name from
(
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
(
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
UNION
SELECT
fields
FROM
tables
WHERE
conditions
) A
Tom
April 21, 2006 at 2:25 pm
Thank you for your help!
CSDunn
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply