begin
select @iCount='count(wlRank)from yusiyuan_WGCP where wlRank=1'
print @iCount
end我这个@iCount显示出来是"count(wlRank)from yusiyuan_WGCP where wlRank=1"???
而我是想要它显示一个取得的值如:123456

解决方案 »

  1.   

    begin 
    select @iCount= count(wlRank) from yusiyuan_WGCP where wlRank=1 
    print @iCount 
    end 
      

  2.   


    set @iCount=(select count(wlRank)from yusiyuan_WGCP where wlRank=1)
    print @iCount
      

  3.   

    select @iCount=count(wlRank) from yusiyuan_WGCP where wlRank=1
      

  4.   


    begin 
    select @iCount='count(wlRank)from yusiyuan_WGCP where wlRank=1' 
    print @iCount 
    endselect @iCount='count(wlRank)from yusiyuan_WGCP where wlRank=1' 是把'count(wlRank)from yusiyuan_WGCP where wlRank=1' 赋值给@icountselect @iCount=count(wlRank) from yusiyuan_WGCP where wlRank=1
      

  5.   

    begin 
    select 1 from yusiyuan_WGCP where wlRank=1
    print @@rowcount 
    end 
      

  6.   

    begin 
    select @iCount= count(wlRank) from yusiyuan_WGCP where wlRank=1 
    print @iCount 
    end