Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Count two tables with duplicate check
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
![]() |
![]() |