Jump to content

Select This or That


SharkBait

Recommended Posts

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?
Link to comment
https://forums.phpfreaks.com/topic/8496-select-this-or-that/
Share on other sites

[!--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
Link to comment
https://forums.phpfreaks.com/topic/8496-select-this-or-that/#findComment-31089
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.