怎么不用top和set rowcount来查寻表的前n条记录? 就是选出表中按时间排列的前50行,不准用select top 50 * from tb order by ..不准用set rowcount 50 select * from tb order by .. set rowcount 0用一条sql完成。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select *from t awhere (select count(*) from t where 主键<=a.主键)<=50 select identity(int,1,1) as PID,a.* into #t from tb a order by ..select * from #t where PID <=50 如果都不用,神??那只能是用你的where條件了 支持 lsxaa(小李铅笔刀) 的:select *from t awhere (select count(*) from t where 主键<=a.主键)<=50 其实是我用的sybase的数据库,没有top关键字。程序中执行三条语句麻烦。所以出此下策 select *from aa awhere (select count(*) from aa where 日期e<=a.日期)<=50 order by 日期 select *from aa awhere (select count(*) from aa where 日期<=a.日期)<=50 order by 日期 由派生表引发的小思考 SQL2005 ROW_NUMBER() 的性能如何? 存储过程里如何调用存储过程 请问这个SQL语句该怎么写 关于考勤的SQL语句.蛮复制的.. 快照复制和job冲突 asp.net操作ms-sql2005的问题 vc+ADO +SQL server 2000 问题?急急急急 周期性的大批量写数据能用存储过程吗? 请教一个金蝶bom表展开的SQL语句 怎樣對sql server中的表進行加鎖 求解:SQL错误捕获问题
from t a
where (select count(*) from t where 主键<=a.主键)<=50
select *
from t a
where (select count(*) from t where 主键<=a.主键)<=50
from aa a
where (select count(*) from aa where 日期e<=a.日期)<=50 order by 日期
from aa a
where (select count(*) from aa where 日期<=a.日期)<=50 order by 日期