SELECT  ispass=case
  when Result.StudentRseult >=60 then 1
  else 0
  END
  FROM Result WHERE ExamDate="2012-01-01" AND SubjectNo为什么在when Result.StudentRseult >=60 then 1这一句的StudentResult会出现列明无效的错误!

解决方案 »

  1.   

    那说明你那表没那StudentRseult 这个列
      

  2.   


    select * from sys.columns where object_id=object_id('Result')看看有没有这个字段
      

  3.   

    你说的是when Result.StudentRseult >=60 then 1中的Result吗?去掉过但是还是一样列名无效!
      

  4.   

    1、试下别的列有没有问题,
    2、select * from sys.columns where object_id=object_id('Result' 这个是查找这个表有什么列
      

  5.   


    去掉也提示列名无效,那你用小李子的
    select * from sys.columns where object_id=object_id('Result')查询下看看Result表有没有这个列名