pacchiee Posted October 7, 2009 Share Posted October 7, 2009 Hello, I have a table with the following structure and entries: id|score1|score2|grade 1|90|100|A 2|75|89|B 3|60|74|C 4|40|59|D 5|0|39|E Now, given a score how can I fetch the grade? Example: Given score as 85, I should fetch 'B'. Or is that I need to change the structure of the table altogether? Am new to MySQL; please help. Thanks in Advance! Link to comment https://forums.phpfreaks.com/topic/176801-mysql-selection-query/ Share on other sites More sharing options...
Mchl Posted October 7, 2009 Share Posted October 7, 2009 SELECT grade FROM table WHERE score1 <= 85 AND score2 >= 85 Link to comment https://forums.phpfreaks.com/topic/176801-mysql-selection-query/#findComment-932186 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.