List:General Discussion« Previous MessageNext Message »
From:Patrick J. McEvoy Date:April 15 2008 10:30pm
Subject:Re: select does too much work to find rows where primary key does not match
View as plain text  
> I would have thought your not = though is matching a lot more rows every time..

The field is UNIQUE PRIMARY KEY in both tables, so there
should be 0 or 1 matches.

> I would look into using where not exists as a subselect

My MySQL book (O'Reilly second edition) does not mention
subqueries or EXISTS. I am reading about it online now.

> delete from bar where not exists (select 'y' from foo where foo.phone = bar.phone);
>
> something like that.

Thanks, I'll give it a try.
Thread
select does too much work to find rows where primary key does not matchPatrick J. McEvoy15 Apr
  • Re: select does too much work to find rows where primary key does not matchPhil15 Apr
    • Re: select does too much work to find rows where primary key does not matchddevaudreuil16 Apr
  • Re: select does too much work to find rows where primary key doesnot matchJoerg Bruehe16 Apr
Re: select does too much work to find rows where primary key does not matchPatrick J. McEvoy16 Apr