On 8 May 2002, at 10:13, Augey Mikus wrote:
> On one of my MySQL servers (Dell PowerEdge 800Mhz w/ 512MB RAM), I have
> a couple tables that have about 3 million records in each. However some
> of the records in the tables are duplicates of each other. Here is a
> query that should return the number of unique records for both tables:
>
> select count(*) from table1,table2 where table1.value != table2.value;
Actually, that query will return the number of combinations of a row
from table1 and a row from table 2 where the 'value' columns are not
equal. If there are about 3 million rows in each table, there will
be about 9 trillion rows to count, so it's not surprising that the
query isn't finishing.
--
Keith C. Ivey <keith@stripped>
Tobacco Documents Online
http://tobaccodocuments.org