摘要:
当使用UNION ALL或者UNION时,如果按照NewId()随机排序,那么,不能直接写SQL 代码SELECT TOP 2 * FROM [Article] Where ArticleId < 100 Order By NewId()UNION ALLSELECT TOP 8 * FROM [Article] Where ArticleId > 200 Order By NewId()需要写成SQL 代码SELECT * FROM (SELECT TOP 2 * FROM [Article] Where ArticleId < 100 Order By NewId()) 阅读全文