当前位置:网站首页>Mysql database - single table query (III)

Mysql database - single table query (III)

2022-04-23 19:42:00 X heart

The first 1 Turn off : Sort query results

USE School;

# Please add the implementation code here 
########## Begin ##########

##########  Inquire about 1 All the information of the class will be displayed in descending order  ##########
select * from tb_score where class_id=1 order by score desc;

########## End ##########

The first 2 Turn off : Group query

USE School;

# Please add the implementation code here 
########## Begin ##########

##########  Group query the class name  ##########

select * from tb_class group by class_id;

########## End ##########

  The first 3 Turn off : Use LIMIT Limit the number of query results

USE School;

# Please add the implementation code here 
########## Begin ##########

##########  Query the... In the class 2 Name to number 5 Student information of name  ##########
select * from tb_score order by score desc limit 1,4;

########## End ##########

版权声明
本文为[X heart]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231927030804.html