这个一个简单的考试系统 先上sql语句:
select * FROM (select * from singleproblem where type='1' and testid='1' order by dbms_random.value ) where rownum <= 5 union all select * FROM (select * from singleproblem where type='2' and testid='1' order by dbms_random.value ) where rownum <= 1 union all select * FROM (select * from singleproblem where type='3' and testid='1' order by dbms_random.value ) where rownum <= 1
我做出来随机了,但是因为是用的这个 union all 连接的,所以题目老是先出来单选题,然后复选题,最后才判断题
这3大题里面的题目倒是随机抽的。就是这个顺序好像被union all给套住了。谁在前面他就先随机哪一类题目
关于sql语句字段意思就不用我解释了吧 基本明眼人一看就懂 麻烦大家给个解决方案
芜湖不芜