Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: SQL challenge;-)

Re: SQL challenge;-)

From: christophe <christophe.delcenserie_at_wanadoo.fr>
Date: Thu, 03 May 2001 00:46:06 +0200
Message-ID: <3AF08E2E.3D9F29D0@wanadoo.fr>

Frank an der Heiden a écrit :
>
> hi,
>
> here a little task for all sql-freaks ;-))
>
> i have to tables.
> these tables have the same structure.
> i want to check out which row of <column> of the first table is not
> existing in <column> of the second table.
>
> this sql-statement works:
>
> SELECT <column> FROM <table1> WHERE <column> NOT IN (SELECT <column> FROM
> <table2>);
>
> but it is very very slow, because the second select is done very often if
> you have many rows in table1.
> any simple idea for improving performance?
> a tried to use a join, but i wasn't able to bring it to work, maybe it's too
> late ;-((
>
> good night
> frank

Hi,

  1. use index (see explain plan, you must install a package)
  2. use select ... from table1 minus select ... from table2

christophe delcenserie Received on Wed May 02 2001 - 17:46:06 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US