Wouldn't it be more efficient to

   select sum(aset.volume)
   from aset
   inner join location
      on  location.id = aset.location
   where ...

In Oracle, you will need to use the old join syntax:

   select sum(aset.volume)
   from aset, location
   where location.id = aset.location and ...

Regards,
Dennis.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, 9 April 2001 18:54
To: Multiple recipients of list delphi
Subject: [DUG]: Temporary table


Hi,

I use Delphi 5 and SQL Server, to increase speed of query some time I used
temporary table, beacuse without temporary table the query was :
   select sum(volume) from aset where location in (select id from location
   where ...)

using caluse IN, the  index does not run (the speed is very low)

Then, I changed then query :
   select sum(volume) from aset, #loc where location=id

before the query, the temporary table (#loc) was created and fill with
location to be prossess with the second way the speed increase

Now I need to change the Database to Oracle ...
Any one know how to create temporary table in Oracle like in SQl-Server ?

this is the description how to create temporary table in SQl-Server:

SQL Server supports two types of temporary tables: local and global.
A local temporary table is visible only to the connection that created it.
A global temporary table is available to all connections.
Local temporary tables are automatically dropped at the end of the current
session.
Global temporary tables are dropped at the end of the last session using
the table (normally, this is when the session that created the table ends).

Temporary tables named with # and ## can be created by any user.
Once the temporary table is created, the owner of the local table is the
only one
who can access that table. Permissions cannot be granted on local temporary
tables.
Once a global temporary table is created, all users can access it;
permissions
cannot be explicitly revoked. Explicitly creating a temporary table in
tempdb
(named without a pound sign) can be performed only by those with explicit
CREATE TABLE permission in the tempdb database. Permission can be granted to
and
revoked from these tables.
Because temporary tables are not generally maintained for long
(they are automatically dropped by the system), because referenced objects
could be
dropped (drop dependencies), and because FOREIGN KEY constraints are not
enforced,
a simplified CREATE TABLE syntax can be used:

CREATE TABLE #[#]table_name
(column_definition [, next_column_definition]...)

thank's
Dedy

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to