forumnz Posted August 22, 2008 Share Posted August 22, 2008 I want to select * from a database where unit is equal to either A or B. How is this done? Would it be... WHERE unit BETWEEN A AND B...? Thanks Sam Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted August 22, 2008 Share Posted August 22, 2008 SELECT * FROM table WHERE unit='A' OR unit='B' Quote Link to comment Share on other sites More sharing options...
Fadion Posted August 23, 2008 Share Posted August 23, 2008 or you could do: SELECT * FROM table WHERE unit IN ('A', 'B') The "BETWEEN A AND B" isn't a correct syntax and obviously doesn't do what you want to achieve. It will find if the field is in the range of two integers. Example: SELECT * FROM table WHERE id BETWEEN 10 AND 100 //will find the values of id >= 10 AND <= 100 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.