MySQL Forums
Forum List  »  Knowledge Base

Re: What would be the best query
Posted by: Paul Svirin
Date: October 21, 2009 11:28AM

Try this one:

SELECT
CASE WHEN count(*)=0 THEN 0 ELSE 1 END
FROM tbl1 a JOIN tbl1 b
ON a.box_id=1 and b.box_id=2 and a.box_val=b.box_val

-------------------
StarWind Software developer ( http://www.starwindsoftware.com )

Options: ReplyQuote


Subject
Views
Written By
Posted
2596
October 20, 2009 02:26PM
Re: What would be the best query
1676
October 21, 2009 11:28AM
1621
October 28, 2009 06:07AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.