I would pay $5 to the first person who could convert this query from using subquery inside to use JOIN : SELECT count( * ) AS count FROM triple_aaa, triple_bbb WHERE triple_aaa.id =66 OR triple_aaa.id IN ( SELECT id FROM triple_bbb WHERE high =66 ) Not to use IN (subquery) , you can use join . Send Me Query , if its working I would pay $5 thru Paypal right away and will post a message that job is done.
to creativeGenius: Original query generates Count:926592 Your query generates : COunt : 0 And I think its because in original query "high"=66 related to SELECT id from triple_bbb and in your query its doesnt related to anything.
ok, can you please try this one... SELECT count (*) as count FROM triple_aaa INNER JOIN triple_bbb ON triple_aaa.id = triple_bbb.id WHERE triple_aaa.id = 66 OR triple_bbb.high = 66
SHOwnsYou Is the WinNer. That is his query: SELECT COUNT(triple_aaa.column), COUNT(triple_bbb.column) FROM triple_aaa, triple_bbb WHERE triple_aaa.id = 66 OR triple_bbb.high = 66