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 -> count record from two tables with duplicate check

count record from two tables with duplicate check

From: <MHakimjavadi_at_gmail.com>
Date: 13 Sep 2005 17:44:29 -0700
Message-ID: <1126658669.080666.261930@z14g2000cwz.googlegroups.com>


Hi

I need to count the number record in two tables with duplicate check, so I have:

Table a - X

          Y
          Z

Table B   X
          W
          K

The query should return 5 because recode X is duplicate. I tried like this:

Select count(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.

Thanks Received on Tue Sep 13 2005 - 19:44:29 CDT

Original text of this message

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