上一条记录的SQL语句: select top 1 * from news where newsid<id order by newsid DESC 下一条记录的SQL语句: select top 1 * from news where newsid>id order by newsid ASC 开发中遇到需要在当前页面显示当前文章的上一篇文章和下一篇文章,百度了一下,搜索到以上SQL语句:
查询及删除重复记录的SQL语句 1.查找表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断select * from peoplewhere peopleId in (select peopleId from people group by peopleId having count(peopleId) > 1) 2.删除表中多余的重复记录,重复记录是根据单个字段(peopleId)来判断,只留有rowid最小的记录delete from people where