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: Count two tables with duplicate check

Re: Count two tables with duplicate check

From: Rene Nyffenegger <rene.nyffenegger_at_gmx.ch>
Date: Thu, 15 Sep 2005 20:32:59 +0000 (UTC)
Message-ID: <dgclpr$e9f$1@klatschtante.init7.net>


On 2005-09-14, Geoff Muldoon <geoff.muldoon_at_trap.gmail.com> wrote:
> MHakimjavadi_at_gmail.com says...
>
>> I need to count the number record in two tables with duplicate check,
>> so I have:
>
>> Select (DISTINCT AAA) from
>> (Select emp_num AAA from A
>> union all
>> Select emp_num AAA from B)
>>
>> and it is working fine but very slow. Please advice.
>
> Look up the difference between "union all" and just "union".

A 'union' will give the OP poster (and everybody else for that matter) all records instead of only the requested five.

-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
Received on Thu Sep 15 2005 - 15:32:59 CDT

Original text of this message

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