update cb a set itv=(select b.complete_date from cust_order b,co_customer_facing_serv c where a.prod_id=b.prod_id 
and b.co_id=c.co_id and c.serv_spec_id=215 and c.state='ADD' and b.complete_date)<>to_datea.ITVdt)该语句不晓得是不是时间类型比较的问题,还是其他问题,
a表中itv 取的是 不等于 a中ITVdt的时间,可以肯定的是不只一条数据,上面语句可以运行但是就是没有结果

解决方案 »

  1.   

    如果不确定是否为一条记录,可以将update语句写成select语句
      

  2.   

    2楼,记录肯定不止一条,就是没得出来,估计问题出现在最后一个字段,都是date 类型的
      

  3.   

    update cb a set itv=(select b.complete_date from cust_order b,co_customer_facing_serv c where a.prod_id=b.prod_id  
    and b.co_id=c.co_id and c.serv_spec_id=215 and c.state='ADD' and b.complete_date)<>to_datea.ITVdt)首先,sql语句格式不对
    其次,lz似乎没有将问题描述清楚,如果是select子句中有多条记录值,外层的update语句有何意义呢?
      

  4.   

    sql不正确。建议把表结构发出来,把要更新的字段说明一下。
      

  5.   

    -- 还应该加上:where exists(......)