--
sql 2000
select
*
from
(
select
*
, number
=
(
select
count
(
*
)
from
tb
where
id
<
t.id)
+
1
from
table t
) m
where
number
=
你指定的数值.
--
sql 2005
select
*
from
(
select
*
, number
=
row_number()
over
(
order
by
id)
from
table
) m
where
number
=
你指定的数值.
转载于:https://www.cnblogs.com/msli/archive/2010/12/31/1922856.html