Re: [PERFORM] join vs exists

2010-06-20 Thread Kevin Grittner
AI Rumman wrote: > Which one is good - join between table or using exists in where > condition? Your example wouldn't return the same results unless there was at most one matching row in b and one matching row in c, at least without resorting to DISTINCT (which you don't show). So, be careful

[PERFORM] join vs exists

2010-06-20 Thread AI Rumman
Which one is good - join between table or using exists in where condition? Query 1; Select a.* from a where exists ( select 1 from b inner join c on b.id1 = c.id where a.id = b.id) Query 2: select a.* from a inner join (select b.id from b inner join c on b.id1 = c.id) as q on a.id = q.id Any su