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

Home -> Community -> Usenet -> c.d.o.misc -> Re: count record from two tables with duplicate check

Re: count record from two tables with duplicate check

From: Isa <isapmon_at_terra.es>
Date: 14 Sep 2005 01:51:30 -0700
Message-ID: <1126687890.574991.250620@g49g2000cwa.googlegroups.com>


Hi:
in your select the "distinct" is not necessary, because when you do an union, the selected records appear only once. You can prove without distinct:
Select count( AAA) from
  (Select emp_num AAA from A
   union all
   Select emp_num AAA from B)

It's can run a little fastest, but I donīt know if it's will be much better.
Try it,

Regards,
Isa Received on Wed Sep 14 2005 - 03:51:30 CDT

Original text of this message

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