mlly1983 发表于 2008-3-4 12:59

求一SQL语名,用的是SQL数据库,怎样取出倒序排列top10的第二条记录

求一SQL语名,用的是SQL数据库,怎样取出倒序排列top10的第二条记录

wklhdt 发表于 2008-3-4 16:47

select * from tb where id not in(select top 1 id fom tb order by id desc) order by id desc

supermancool 发表于 2008-3-6 21:21

[quote][bo]以下是引用 [un]wklhdt[/un] 在 2008-3-4 16:47 的发言:[/bo]

select * from tb where id not in(select top 1 id fom tb order by id desc) order by id desc [/quote]
看不太懂,能解释一下吗?

冰雪之源 发表于 2008-3-6 22:33

这个第二条记录怎么取呢

wyg4859 发表于 2008-3-7 13:41

select top 1 * from tb where id not in(select top 1 id fom tb order by id desc) order by id desc

页: [1]

编程论坛