Jump to content

Archived

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

DaveLinger

SELECT * WHERE row "is between 9 and 10"?

Recommended Posts

I'm working on script which will check the score of each game review in a database, and display any games with a score between 9 and 10. (This may include "9", "9.2", "9.75", "10")

How would I work that into an SQL query?

Thanks!

Share this post


Link to post
Share on other sites
Well assuming that 10 is the highest you can get ... you can do:
SELECT * FROM `tablename` WHERE `score` >= '9'

Or you you can do:
SELECT * FROM `tablename` WHERE `score` >= '9' AND `score` <= '10'

Share this post


Link to post
Share on other sites
Sorry, I didn't read the question as carefully as I should have.  Yes, WHERE >=9 AND <=10 is the correct clause.

Share this post


Link to post
Share on other sites
you could even use the thing designed for it!!!

SELECT * FROM `tablename` WHERE `score` BETWEEN 8 AND 11

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.