好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

随机抽取的sql语句 每班任意抽取3名学生

学校有一、二、三。。。。至十班。
假设每个班上有30名学生。张、李、刘、苏等
现有这样的表 s js tudent ,字段 编程 class 及nam js e 。其中class 表示班级,name 表示每班学生姓名。
要求每班任意抽取3名学生出来,进行学校大扫除。

请写出这样的SQL语句。

select name 
from (select (row_number()   编程  over (partition by class order by checksum(n NivlTuEc ewid()))) id,* 
from student ) a 
where id<=3

查看更多关于随机抽取的sql语句 每班任意抽取3名学生的详细内容...

  阅读:38次