List:General Discussion« Previous MessageNext Message »
From:Javier Yévenez Date:November 9 2011 3:18pm
Subject:Re: Issue With Subqueries
View as plain text  
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

Thread
Issue With SubqueriesMike Seda9 Nov
  • Re: Issue With SubqueriesMySQL)9 Nov
    • Re: Issue With SubqueriesJavier Yévenez9 Nov
      • Re: Issue With SubqueriesJohan De Meersman10 Nov
    • Re: Issue With SubqueriesJohan De Meersman10 Nov
Re: Issue With SubqueriesMike Seda9 Nov