Re: Relational query question

2015-09-30 Thread Divesh Kamra
It better to LEFT join rather then NOT IN On Wed, Sep 30, 2015 at 6:00 PM, Mogens Melander wrote: > Maybe not the most optimal, but (probably) the most simple: > > SELECT * FROM fruit > where id not in (select fruit from purchase > where customer=1); > > 1, 'Apples' > 3, 'Oranges' > > > On 20

Re: Relational query question

2015-09-30 Thread Mogens Melander
Maybe not the most optimal, but (probably) the most simple: SELECT * FROM fruit where id not in (select fruit from purchase where customer=1); 1, 'Apples' 3, 'Oranges' On 2015-09-30 00:01, Richard Reina wrote: If I have three simple tables: mysql> select * from customer; +++ | ID