可以是可以,不过土了点,用个子查询。
select top 10 *,(select count(1) from table) as cnt from table where id not in ..
这样有一个问题。就是你查询出来的每条记录里,都带一个总行数。
select *,(select count(*) from t1) from(
select top 2 * from(
select top 4 * from(
select * from t1
)as ttb0 order by id
)as ttb1 order by id desc
)as ttb2 order by id
在select后加个子查询就OK了,