Get the App
SLTechnology News&Howtos  ›  Database  › 

How to use a sql statement to find out a student's name, score and ranking in the table

Shulou Source: shulou.com Published: 2022-05-31 17:44:13 10月03日 Update

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

Tags: Grades sentences students names queries learning content same two names fields that is ideas situations articles methods time more defects knowledge Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno MySQL Huawei MariaDB Shulou Tech Info