学校有一、二、三。。。。至十班。
假设每个班上有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名学生的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did250829