: mysql
Cc: Harish; Michael Stassen
Subject: Re: Need a query to get the difference of two tables
Harish wrote:
> Hi All,
>
> This query worked for me.
>
> SELECT a.address
>FROM a
>LEFT JOIN b ON a.id != b.iid AND b.message='y'
Strange... that query sho
Harish wrote:
Hi All,
This query worked for me.
SELECT a.address
FROM a
LEFT JOIN b ON a.id != b.iid AND b.message='y'
Strange... that query should give far too many and wrong rows as a
result, and it would take a long time to run on a big dataset... you are
joining each row in table a with
:15 PM
To: mysql
Cc: Michael Stassen
Subject: Re: Need a query to get the difference of two tables
Michael Stassen wrote:
>
> Roger Baklund wrote:
[...]
>> select a.address
>> from a
>> left join b on b.iid=a.id
>> where b.iid is null;
>
>
> That
ubject: Re: Need a query to get the difference of two tables
Roger Baklund wrote:
> Harish wrote:
>
>> Hi,
>>
>> I apprecaite anybody replying me with an equvalent query for this:
>> I am using mysql 4.0.21
>>
>>
>> select a.address from a wh
Michael Stassen wrote:
Roger Baklund wrote:
[...]
select a.address
from a
left join b on b.iid=a.id
where b.iid is null;
That's not equivalent, because it leaves out a condition. I think it
should be
SELECT a.address
FROM a
LEFT JOIN b ON a.id = b.iid AND b.message='y'
WHERE b.iid
ubject: Re: Need a query to get the difference of two tables
Roger Baklund wrote:
> Harish wrote:
>
>> Hi,
>>
>> I apprecaite anybody replying me with an equvalent query for this:
>> I am using mysql 4.0.21
>>
>>
>> select a.address from a wh
ng the ids to strings to be compared. Ouch.
Michael
-Original Message-
From: Roger Baklund [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 30, 2005 7:19 PM
To: mysql
Cc: Harish
Subject: Re: Need a query to get the difference of two tables
Harish wrote:
Hi,
I apprecaite anybody replyin
Roger Baklund wrote:
Harish wrote:
Hi,
I apprecaite anybody replying me with an equvalent query for this:
I am using mysql 4.0.21
select a.address from a where a.id not in (select b.iid from b where
b.message='y')
This can be done with a left join:
select a.address
from a
left join b on b.iid=
SELECT
a.address
FROM
a,
b
WHERE
(a.id LIKE b.id) AND
(b.message NOT LIKE 'y')
-Original Message-
From: Roger Baklund [mailto:[EMAIL PROTECTED]
Sent: Sunday, January 30, 2005 7:19 PM
To: mysql
Cc: Harish
Subject: Re: Need a query
Harish wrote:
Hi,
I apprecaite anybody replying me with an equvalent query for this:
I am using mysql 4.0.21
select a.address from a where a.id not in (select b.iid from b where
b.message='y')
This can be done with a left join:
select a.address
from a
left join b on b.iid=a.id
where b.iid is
10 matches
Mail list logo