SharkBait Posted April 26, 2006 Share Posted April 26, 2006 Hi, I have a MySQL query that looks like this:SELECT * FROM test where test1 = 'Y' OR test 2 = 'N' AND testname = 'MINE'Now I understand that is wrong, but I am not sure how to make the query do what I want.I want to make the query true if test1 = Y OR test2 = N or even both.How can do this properly? Quote Link to comment Share on other sites More sharing options...
onepixel Posted April 26, 2006 Share Posted April 26, 2006 How about SELECT * FROM test where (test1 = 'Y' OR test 2 = 'N') AND testname = 'MINE' Quote Link to comment Share on other sites More sharing options...
SharkBait Posted April 26, 2006 Author Share Posted April 26, 2006 [!--quoteo(post=368987:date=Apr 26 2006, 01:40 PM:name=onepixel)--][div class=\'quotetop\']QUOTE(onepixel @ Apr 26 2006, 01:40 PM) [snapback]368987[/snapback][/div][div class=\'quotemain\'][!--quotec--]How about SELECT * FROM test where (test1 = 'Y' OR test 2 = 'N') AND testname = 'MINE'[/quote]Thats what I thought. Hehe silly me.Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.