Relative Content

Tag Archive for enumerate

Renumerate in SQL

I wonder if this enumeration is possible using SQL. The grouping is by id and year, if the grade is less than 9, I want to assign a 0 else if the grade is in (9, 10,11,12, SS), I would like the count to start at 1 for the first time the grade is in (9, 10,11,12, SS) and increase by 1 as the year increases. Not sure how to achieve this.

Renumerate in SQL

I wonder if this enumeration is possible using SQL. The grouping is by id and year, if the grade is less than 9, I want to assign a 0 else if the grade is in (9, 10,11,12, SS), I would like the count to start at 1 for the first time the grade is in (9, 10,11,12, SS) and increase by 1 as the year increases. Not sure how to achieve this.