union order by newid()不能一起用,请高手来看看!
select top 3 * from a where type = 1 union select top 2 * from a where type = 1可以实现,
但我想满足type=1的随机取3条数据,满足type=1的取随机2条数据怎么实现?
用select top 3 * from a where type = 1 order by newid() union select top 2 * from a where type = 1 order by newid()
就出错,望高手给点指点,谢谢!