新手问题,老大们别界外。
update t_pc_branch_price 
set t_pc_branch_price.status = '1', t_pc_branch_price.com_flag='0'
where exists (select t_bd_item_info.build_date from t_bd_item_info)
AND (t_bd_item_info.build_date > '2011-08-10 00:00:00.000')
AND (t_pc_branch_price.item_no = t_bd_item_info.item_no)
AND (t_pc_branch_price.supcust_no = '0800019')
AND (t_pc_branch_price.branch_no = '01')服务器: 消息 107,级别 16,状态 3,行 1
列前缀 't_bd_item_info' 与查询中所用的表名或别名不匹配。
服务器: 消息 107,级别 16,状态 1,行 1
列前缀 't_bd_item_info' 与查询中所用的表名或别名不匹配。
t_pc_branch_price主要是要用到item_no,supcust_no,branch_no作为条件,更改status和com_flag的数据
t_bd_item_info,主要是用到item_no,build_date里面的数据头疼啊。新手新手。老大们帮帮忙。

解决方案 »

  1.   

    update t_pc_branch_price  
    set t_pc_branch_price.status = '1', t_pc_branch_price.com_flag='0'
    from t_pc_branch_price
    where exists (select t_bd_item_info.build_date 
              from t_bd_item_info)
            where t_bd_item_info.build_date > '2011-08-10 00:00:00.000'
              AND t_pc_branch_price.item_no = t_bd_item_info.item_no
              AND t_pc_branch_price.supcust_no = '0800019'
              AND t_pc_branch_price.branch_no = '01')
      

  2.   


    --修改
    update t_pc_branch_price  
    set t_pc_branch_price.status = '1', t_pc_branch_price.com_flag='0'
    from t_pc_branch_price
    where exists (select t_bd_item_info.build_date 
              from t_bd_item_info
                where t_bd_item_info.build_date > '2011-08-10 00:00:00.000'
              AND t_pc_branch_price.item_no = t_bd_item_info.item_no
              AND t_pc_branch_price.supcust_no = '0800019'
              AND t_pc_branch_price.branch_no = '01')
      

  3.   

    from t_pc_branch_price
    少了这么一句?
      

  4.   

    update
     t_pc_branch_price  
    set
     t_pc_branch_price.status = '1', t_pc_branch_price.com_flag='0'
    from
     t_pc_branch_price
    where
     exists(select
               t_bd_item_info.build_date 
            from
               t_bd_item_info
            where
               t_bd_item_info.build_date > '2011-08-10 00:00:00.000'
            and
               t_pc_branch_price.item_no = t_bd_item_info.item_no
            and
               t_pc_branch_price.supcust_no = '0800019'
            and
               t_pc_branch_price.branch_no = '01')