Re: Temporary work tables (a beginner's question)

From: Wayne Linton <lintonw_at_cadvision.com>
Date: 1997/07/02
Message-ID: <33BB27A6.4813_at_cadvision.com>#1/1


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 CEST

Original text of this message