DaveLinger Posted August 9, 2006 Share Posted August 9, 2006 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! Quote Link to comment Share on other sites More sharing options...
bltesar Posted August 9, 2006 Share Posted August 9, 2006 SELECT * FROM games WHERE score>8 and score<11 Quote Link to comment Share on other sites More sharing options...
Corona4456 Posted August 9, 2006 Share Posted August 9, 2006 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' Quote Link to comment Share on other sites More sharing options...
bltesar Posted August 9, 2006 Share Posted August 9, 2006 Sorry, I didn't read the question as carefully as I should have. Yes, WHERE >=9 AND <=10 is the correct clause. Quote Link to comment Share on other sites More sharing options...
DaveLinger Posted August 9, 2006 Author Share Posted August 9, 2006 Thanks guys Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted August 9, 2006 Share Posted August 9, 2006 you could even use the thing designed for it!!!SELECT * FROM `tablename` WHERE `score` BETWEEN 8 AND 11 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.