通过一查询语句,返回20行的记录,这20行的记录除个一列数据为某一固定项外,
其他的都为空?表中也没数据?这样的语句怎样写?

解决方案 »

  1.   

    select top 20 id = 1 , col = '' from tb
      

  2.   

    select   top   20   id   =   1   ,   col   =   null   from   tb
    select   top   20   id   =   1   ,   col   =   ''     from   tb
      

  3.   

    select top 20 'a' as col1,' ' as col2,....
    from sysobjects a ,sysobjects b 
      

  4.   

    表中也没数据?那乌龟的也查不到数据!对。select   top   20   id   =   1   ,   col   =   null   from   sysobjects   a   ,sysobjects   b select   top   20   id   =   1   ,   col   =   ''     from   sysobjects   a   ,sysobjects   b 
      

  5.   


    select   top   20   id   =   1   ,   col   =null   from  sysobjects
      

  6.   


    select top 20 id=1 ,col='',co2='' from syscolumns