摘要: SELECT DISTINCT b.VendorName,b.SysNo FROM shipType a WITH(NOLOCK) INNER JOIN vendor b WITH(NOLOCK) ON a.MerchantSysNo=b.SysNo1.select * from classinfoselect *,row_number() over(partition by className order by id) c from classinfoselect * from( select *,row_number() over(partition by className order 阅读全文
posted @ 2011-02-23 12:31 凌鸢 阅读(1255) 评论(0) 推荐(0) 编辑
摘要: 总结如下:我创建了一个表,数据如下,SQL> select * from test; A1 A2---------- ---------- 1 3 2 4 3 2 3 5 4 2然后用rank () over,SQL> select a1,a2,rank () over (order by a1) rank from test; A1 A2 RANK---------- ---------- ---------- 1 3 1 2 4 2 3 2 3 3 5 3 4 2 5SQL> select a1,a2,rank () over (order by a2) rank fro 阅读全文
posted @ 2011-02-23 12:00 凌鸢 阅读(8617) 评论(0) 推荐(0) 编辑