±ÈÈçÏëÈ¡³ö±íaÖеÚ50µ½µÚ100Ö®¼äµÄ¼Ç¼£¬±íÖв¢Ã»ÓбêÖ¾µ±Ç°¼Ç¼Êǵڼ¸Ìõ¼Ç¼µÄ×ֶΣ¬ÇëÎÊÓ¦¸ÃÔõôʵÏÖ£¿ÔÚOracleÖÐÓÐrownumÕâÑùµÄαÁУ¬²»ÖªµÀÔÚms sqlÖÐÓÐûÓÐÏàͬ¹¦ÄܵÄ×Ö¶ÎSQL code: --2005 row_number() ;with wufeng4552 as ( select *,cnt=row_number()over (order by getdate()) ) select * from wufeng4552 where cnt between 50 and 100 --2000¼Ó×ÔÔöÁÐ°É alter table tb add cnt int identity go select * from wufeng4552 where cnt between 50 and 100 go alter table tb drop column cnt
SELECT ROW_NUMBER() OVER (ORDER BY ID ASC) AS ROWID, * from a
--2005 row_number() SQL code: ;with wufeng4552 as ( select *,cnt=row_number()over (order by getdate()) ) select * from wufeng4552 where cnt between 50 and 100 --2000¼Ó×ÔÔöÁÐ°É alter table tb add cnt int identity go select * from tb where cnt between 50 and 100 go alter table tb drop column cnt