有一张试题表test
字段pub为是否为必选题(取1或0)。
任易查100道试题的select为
select top 100 * from test;现在我想查100道题 由20道必选和80道非必选题组成 ,
只用一个这条select语句怎么写呢?
字段pub为是否为必选题(取1或0)。
任易查100道试题的select为
select top 100 * from test;现在我想查100道题 由20道必选和80道非必选题组成 ,
只用一个这条select语句怎么写呢?
调试欢乐多
union all
select top 80 * from test where pub = 0 order by newid()
摆脱 救我
只使用union,不使用union all试试看?
就正常了 谢谢啦