Hi,
mysql> select count(distinct field1) from db2.table1 where field1 not in >> (select field1 from db1.table1); >> +------------------------+ >> | count(distinct field1) | >> +------------------------+ >> >> If the field db1.table1.field1 has the same name that the field db2.table1.field1, maybe you have to use an alias for each table: try: mysql> select count(distinct A.field1) from db2.table1 A where field1 not in (select B.field1 from db1.table1 B); -- Javier