Jump to content

Longer Queries


Hartley

Recommended Posts

For some reason I'm having trouble with some queries that are longer. I am new to mySQL, so sorry if the question seems rather foolish. There's a table with a lot of numbers in it. For this example, let's just assume there are 3 columns. I want to select all rows that have either the values of 1 or 2 for A, a value of 0 for B, and is greater than 3 for C while sorting by Column C.

SELECT * FROM table WHERE B='0' AND C>'3' AND A='1' OR A='2' ORDER BY C DESC

This is logically what I come up with, but it likes to ignore the C>'3' and doesn't always acknowledge the B='0'. REALLY confused. Thanks in advance.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.