执行从查询语句中,直接显示出20行记录?

stevenhzj 2007-11-12 03:37:18
通过一查询语句,返回20行的记录,这20行的记录除个一列数据为某一固定项外,
其他的都为空?表中也没数据?这样的语句怎样写?
...全文
119 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
fa_ge 2007-11-12
  • 打赏
  • 举报
回复

select top 20 id=1 ,col='',co2='' from syscolumns
kk19840210 2007-11-12
  • 打赏
  • 举报
回复

select top 20 id = 1 , col =null from sysobjects
dawugui 2007-11-12
  • 打赏
  • 举报
回复
表中也没数据?那乌龟的也查不到数据!

对。

select top 20 id = 1 , col = null from sysobjects a ,sysobjects b select top 20 id = 1 , col = '' from sysobjects a ,sysobjects b
dobear_0922 2007-11-12
  • 打赏
  • 举报
回复
表中也没数据?那乌龟的也查不到数据!
-狙击手- 2007-11-12
  • 打赏
  • 举报
回复
select top 20 'a' as col1,' ' as col2,....
from sysobjects a ,sysobjects b
dawugui 2007-11-12
  • 打赏
  • 举报
回复
select   top   20   id   =   1   ,   col   =   null   from   tb
select top 20 id = 1 , col = '' from tb
dawugui 2007-11-12
  • 打赏
  • 举报
回复
select top 20 id = 1 , col = '' from tb

34,593

社区成员

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

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