-2

Let's say I have these data:

Student Class
Henry   Chemistry
John    Physics
Cole    Philosophy
Fabio   Literature

How can I query a range and get this :

Student Class       Number
Henry   Chemistry   1
John    Physics     2
Cole    Philosophy  3
Fabio   Literature  4

?

Your Common Sense
  • 154,967
  • 38
  • 205
  • 325
enas dyo
  • 3
  • 2
  • 2
    When you have MySQL 8.0+, you can use [ROW_NUMBER](https://dev.mysql.com/doc/refman/8.0/en/window-function-descriptions.html#function_row-number), or when using PostgreSQL, use [ROW_NUMBER](https://stackoverflow.com/questions/11952245/select-row-number-in-postgres), so tell us if you use MySQL, or PostgreSQL, and what version... – Luuk May 28 '22 at 14:31
  • can you share your coding attempt to this problem? @enasdyo – lemon May 28 '22 at 16:55

0 Answers0