How to use a sql statement to find out a student's name, score and ranking in the table
This article mainly explains "how to use a sql sentence to query a student's name, score and ranking in the table". The content in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to use a sql sentence to query a student's name, score and ranking in the table".
Suppose: the table name is Course, and the two fields are name and score respectively.
Implementation statement:
SELECT students, grades, (SELECT COUNT (*) FROM form WHERE a. Score t.cj) mc,name,cj from @ Course t) tem where name='b'
If there is a record of the same score, goodspeed's sentence does have some flaws, but I modified it a little bit according to his sentence and it would be perfect.
SELECT name,score, (SELECT COUNT (*) + 1 FROM course WHERE a.score