0

SELECT name, address FROM global WHERE (type=3) AND WHERE (id BETWEEN 3 and 7); syntax issue. but the idea is to only get row between 3 and 7 from the type 3 column.

I remove one of the () so WHERE(type=3) AND WHERE id BETWEEN 3 and 7. same error

2
  • Use the handy github link for Mysql related syntax issues: gist.github.com/hofmannsven/9164408 Commented Nov 5, 2017 at 6:18
  • Thanks, this is gold Commented Nov 5, 2017 at 6:21

1 Answer 1

1

You should use a between operator as below:

SELECT name, address FROM global WHERE type=3 
AND id BETWEEN 3 and 7;
Sign up to request clarification or add additional context in comments.

2 Comments

i.e. remove the second WHERE. The parenthesis are entirely optional.
Thanks, second where was not necessary. Now i got it

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.