Ads were blocked - no problem. But keep in mind that developing HeidiSQL, user support and hosting takes time and money. You may want to send a donation instead.

How to countif on 1 row of data (looking at 1 row and different columns)?

vnikougo's profile image vnikougo posted 4 years ago in Running SQL scripts Permalink

Hi, Assume I have a grade list for students as below: StudentID StudentName Class1Grade Class2Grade Class3Grade ....... 01 John 88 92 75 02 Jack 76 84 96 03 Tom 65 78 80 ....

I need a to see for each student what percentage of grades are above 90, what percentage between 81 and 90, what percentage between 71 and 80 and what percentage below 70. There are a lot of columns in the table (around 300!) and this is how the database is designed.

Is this something possible with HeidiSql? Please help achieving that, or let me know if you have any idea how to approach it. Thanks a lot.

Please login to leave a reply, or register at first.