List:General Discussion« Previous MessageNext Message »
From:James Moe Date:May 26 2003 5:33am
Subject:Re: select on three tables and multiple entries
View as plain text  
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 25 May 2003 15:04:07 -0400, Aram Mirzadeh wrote:

>One thing I should mention is that the values in both agentaddr and
>realAddress are not unique.  So there could be multiple rows with that
>IP address in each database.  
>
>mysql> select count(agentaddr),count(distinct(agentaddr)) from
>tempPollerCfg;
>+------------------+----------------------------+
>| count(agentaddr) | count(distinct(agentaddr)) |
>+------------------+----------------------------+
>|           126455 |                        664 |
>+------------------+----------------------------+
>
  Run your query using distinct, then:

select count(distinct temppending) from tempPending,tempPollerCfg where
tempPending.realAddress=tempPollerCfg.agentaddr;


- --
jimoe at sohnen-moe dot com
pgp/gpg public key: http://www.keyserver.net/en/
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0 OS/2 for non-commercial use
Comment: PGP 5.0 for OS/2
Charset: cp850

wj8DBQE+0acPsxxMki0foKoRAsG2AKCwLmdqv70UnPdYy8DWRmevNipEvACePCU7
csnJlKZ6JoHDoHM4zSjGF50=
=DnrV
-----END PGP SIGNATURE-----


Thread
select on three tables and multiple entriesAram Mirzadeh25 May
  • Re: select on three tables and multiple entriesJames Moe25 May
    • Re: select on three tables and multiple entriesAram Mirzadeh25 May
      • Re: select on three tables and multiple entriesJames Moe26 May