| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Patrick J. McEvoy | Date: | April 16 2008 12:30am |
| 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 match | Patrick J. McEvoy | 15 Apr |
| • Re: select does too much work to find rows where primary key does not match | Phil | 15 Apr |
| • Re: select does too much work to find rows where primary key does not match | ddevaudreuil | 16 Apr |
| • Re: select does too much work to find rows where primary key doesnot match | Joerg Bruehe | 16 Apr |
| • Re: select does too much work to find rows where primary key does not match | Patrick J. McEvoy | 16 Apr |
