请问一个SQL语句

adw3scgw432sfw 2006-04-25 09:42:08
Select Top 1 name from sysobjects where xtype='U'
这个SQL语句是取当前数据库中第一个表的名字,我想取第二个表的名字怎么取呢?
我用 Select Top 2 name from sysobjects where xtype='U' 它把前两个表的名字都打打印出来了。我只想要第二个表的名字
...全文
139 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
huailairen 2006-04-25
  • 打赏
  • 举报
回复
楼主没有用排序规则,筛选出来的数据会不稳定。
xeqtr1982 2006-04-25
  • 打赏
  • 举报
回复
高捷正解 :)
FCU 2006-04-25
  • 打赏
  • 举报
回复
学习,学习。。。
liangpei2008 2006-04-25
  • 打赏
  • 举报
回复
楼上正解
  • 打赏
  • 举报
回复
Select Top 1 name from sysobjects where xtype='U' and (name not in (Select Top 1 name from sysobjects where xtype='U'))
妙恋大果梨 2006-04-25
  • 打赏
  • 举报
回复
Select Top 1 name from sysobjects where xtype='U'(1)not in(select top1)
试试对不对?记得差不太多...有些忘了...

34,838

社区成员

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

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