select studentid,isnull(score,0)as score from studnet

解决方案 »

  1.   

    TO: LBYYBL(o_o)
             谢谢!试用了,可以.
    不过我想问一下.能在select语句中嵌入if语句么.
      

  2.   

    那怎样用select 加if 来完成上面的问题.
      

  3.   

    没有if语句,要用case语句
    select studentid,case( when score is null then 0 else score end)as score from studnet
      

  4.   

    to  wang_jzh(casper): 好像不行哦,系统报错说,在关键字 'when' 附近有语法错误。
      

  5.   

    select studentid,(case when score is null  then 0 else score end) as score1 from student