摘要: 1 rowcount的用法: 2 3 rowcount的作用就是用来限定后面的sql在返回指定的行数之后便停止处理,比如下面的示例, 4 set rowcount 10 5 select * from 表A 6 7 这样的查询只会返回表A中的前10条数据。它和 "select top 10 * from 表A" 的作用一样。注意一点,set rowcount 的设置会在整个会话... 阅读全文
posted @ 2016-05-09 20:51 温故余学 阅读(2118) 评论(0) 推荐(0)
摘要: with tabs as ( select ROW_NUMBER() over(partition by customerID order by totalPrice) as rows,customerID,totalPrice, DID from OP_Order ) select MAX(rows) as '下单次数',customerID from tabs group... 阅读全文
posted @ 2016-05-09 09:03 温故余学 阅读(204) 评论(0) 推荐(0)