JaP
JaP

Reputation: 31

Mysql Where and between query to database

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

Upvotes: 0

Views: 36

Answers (1)

ForeverLearner
ForeverLearner

Reputation: 2103

You should use a between operator as below:

SELECT name, address FROM global WHERE type=3 
AND id BETWEEN 3 and 7;

Upvotes: 1

Related Questions