sql 随机查询兼有UNION

select * from (SELECT * FROM(select top 30 * from jichu where 类型='单选题' order by newid()) AS t1
union  ALL
SELECT * FROM(select top 10 * from tigao where 类型='多选题' order by newid()) as t2) as t

 

好复杂 ,还好解决

你可能感兴趣的:(sql)