Re: How to create temp table in memory in Oracle

From: Robert W. Swisshelm <swisshelm_at_lilly.com>
Date: 1997/07/18
Message-ID: <33CF8F14.69A3_at_lilly.com>#1/1


ChanderR_at_KochInd.com wrote:
>
> Hi;
>
> I am trying to find out the way to create temp table in memory in oracle
> as you do in Sybase or MS SQL server (eg. create table #temp_table). This
> table will stay in memory, will go away at the end of user transaction.
>
> Any help will be greatly appreciated.
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet

I don't think you can do this directly, but you can now use a SELECT statement in a FROM clause to use as a temporary table for the duration of the SELECT.

For example, this report shows the salemen by territory who had the top sales.

Select a.territory, a.sales, a.salesman

	from sales a,
             (select territory, max(sales) sales
                     from sales
                     group by territory) b
        where a.territory = b.territory
          and a.sales = b.sales

-- 
Bob Swisshelm
Eli Lilly and Company
swisshelm_at_lilly.com
Received on Fri Jul 18 1997 - 00:00:00 CEST

Original text of this message