Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Temporary work tables (a beginner's question)
The INTO clause available in the other products is just like a CREATE TABLE AS SELECT .... as you mention. The table is not temporary in the same way, since you would have to drop it explicitly.
An alternative in ORACLE you could try:
SELECT state, CITY, SUM(COUNT1) SUM1, SUM(COUNT2) SUM2
FROM
(SELECT STATE, CITY, 1 AS COUNT1, 0 AS COUNT2
FROM HOMETEST
WHERE AGE > 21
UNION
SELECT STATE, CITY, 0 AS COUNT1, 1 AS COUNT2
FROM HOMETEST
WHERE INCOME > 50000)
GROUP BY state, CITY
Essentially, the object of the FROM clause is like a temporary VIEW. I think this would work for you as I understand your question.
Wayne Linton
Shell Canada Ltd.
David Bradford wrote:
>
> Hi,
>
>snip<
Received on Wed Jul 02 1997 - 00:00:00 CDT
![]() |
![]() |