SQL查找某一条记录的方法
更新时间:2007年04月29日 00:00:00 作者:
SQL查找第n条记录的方法:
select top 1 * from table where id not in (select top n-1 id from table) temptable0
SQL查找第n条开始的m条记录的方法:
select top m * from table where id not in (select top n-1 id from table) temptable0)
(注:表中必须有一个唯一值字段才可适用此方法。)
select top 1 * from table where id not in (select top n-1 id from table) temptable0
SQL查找第n条开始的m条记录的方法:
select top m * from table where id not in (select top n-1 id from table) temptable0)
(注:表中必须有一个唯一值字段才可适用此方法。)
相关文章
sql语句优化之用EXISTS替代IN、用NOT EXISTS替代NOT IN的语句
sql语句优化之用EXISTS替代IN、用NOT EXISTS替代NOT IN的语句...2007-08-08
sql 去零函数 datagridview中数字类型常出现后面的零不能去掉
sql 去零函数 datagridview中数字类型常出现后面的零不能去掉,此函数在sql中使用即可2009-06-06
浅谈SQLServer的ISNULL函数与Mysql的IFNULL函数用法详解
本篇文章是对SQLServer的ISNULL函数与Mysql的IFNULL函数进行了详细的分析介绍,需要的朋友参考下2013-06-06


最新评论