摘要:
1.select * from JT_WEBK_NEWS as a where ( select count(*) from JT_WEBK_NEWS where subclassid=a.subclassid and NEWSID > a.NEWSID ) < 5 order by NEWSID desc 2. SELECT 字段1, 字段2, 字段3FROM (SELECT 字段1, 字段2, 字段3, ROW_NUMBER() OVER(PARTITION BY 字段3 ORDER BY 字段1) rkFROM tab) tWHERE rk <= 2 阅读全文
posted @ 2010-01-15 12:31 yuanws 阅读(136) 评论(0) 推荐(0) 编辑