Jump to content

Archived

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

SharkBait

Select This or That

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?

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

×

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.