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: T <t_at_yahoo.com>
Date: Wed, 14 Sep 2005 13:44:41 +0200
Message-ID: <dg92ij$q54$1@ss405.t-com.hr>


select count(*) from (select aaa from a union all select aaa from b) group by aaa having count(*) > 1

<MHakimjavadi_at_gmail.com> wrote in message news:1126658669.080666.261930_at_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 Wed Sep 14 2005 - 06:44:41 CDT

Original text of this message

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