如何知道检索出某一条数据,在数据库中是第几行!!

xiaoleifeng 2003-08-16 11:32:44
检索出某一条数据后,如何知道它在数据库中是第几行呢?
...全文
100 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bitfubin 2003-10-15
  • 打赏
  • 举报
回复
Select identity(int,1,1) as id,* into #temp from 表 
select * from #temp
drop table #temp
txlicenhe 2003-08-16
  • 打赏
  • 举报
回复
Select identity(int,1,1) as id,* into #temp from 表
select * from #temp
drop table #temp
ysycrazy 2003-08-16
  • 打赏
  • 举报
回复
select identity(int,1,1) as id,* into #xx from lx
select id1 from #xx where 条件
SE1 2003-08-16
  • 打赏
  • 举报
回复
不能知道,因为“第几行”在关系型数据库中是没有意义的:一个表是行的集合,而在集合中是没有顺序的。
sdhdy 2003-08-16
  • 打赏
  • 举报
回复
必须保证这个表里没有标识才可以,否则要把标识的那个字段在列表中去掉
hjb111 2003-08-16
  • 打赏
  • 举报
回复
up

34,874

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧