select * From skywftask_all where instanceid 
not in (Select wfinstanceid From aleave_register )   但是由于笔误 写成了select * From skywftask_all where instanceid 
not in (Select instanceid From aleave_register )   结果没有报错 (aleave_register里面是没有instanceid这个字段的)
事实上单独执行Select instanceid From aleave_register 是有错的!
请问为什么?

解决方案 »

  1.   

    子查询默认和基表(instanceid)关联,所以没报错.
      

  2.   

    没道理。
     是不是你服务器缓存了。
        select * From skywftask_all where instanceid 
    not in (Select instanceid From aleave_register )
     在查询分析器中运行看看
      

  3.   

    肯定会报错的:列名 'instanceid' 无效。
      

  4.   

    会报错的,只是Ctrl+F5不会错
    F5运行就会错的.
      

  5.   

    表中没有instanceid字段,当然会报错
      

  6.   

    问题是instanceid字段存在skywftask_all表中 不在aleave_register表中