update schdule set isSelected='0' where courseID not in('02010000') and catalogLevel not in( '2') and userID = '0000000'
想把除了courseID='02010000'和catalogLevel='2'以外的所有isSelected都变为0
这样写有错“列名 'catalogLevel' 无效。”。
isSelected bit 类型
courseID char 类型
catalogLevel int 类型
大家帮忙看看~谢!

解决方案 »

  1.   

    schdule表中没有catalogLevel列,检查一下是否拼错
      

  2.   

    update  schdule 
    set  isSelected='0' 
    where  courseID <> ('02010000') and 
    catalogLevel <> 2 and 
    userID = '0000000'
      

  3.   

    列名 'catalogLevel' 无效。---这个提示是指你的表中没有  'catalogLevel' 这个列,你可以先执行一下select看看select * from schdule 
    where  courseID <> ('02010000') and 
    catalogLevel <> 2 and 
    userID = '0000000'
      

  4.   

    update schdule set isSelected='0' where courseID not in('02010000') and catalogLevel not in( 2) and userID = '0000000'
    你在定义catalogLevel 时 为integer 型,所以,2不能加引号
      

  5.   

    对!catalogLevel是 另一张表的,但是我就像这个效果该怎么写