update t1
set t1.fmodel=t1.FName+t1.FHelpcode+(select F_103 from t_ICitem where FItemID in (select FItemID from t_icitemcore))
  from t_icitemcore t1 如何将  F_103当成一个条记录来处理。。

解决方案 »

  1.   

    select top 1 F_103 还是不行哦
      

  2.   

    update t1
    set t1.fmodel=t1.FName+t1.FHelpcode+t.F_103
    from t_icitemcore t1,t_ICitem t
    where t.FItemID = t1.FItemID
    --这样试试,操作前最好备份一下
      

  3.   

    检查下不是少个 where 条件 。  in 里不只一个之一个值的时候 ,前面的'+' 怎么完成?
      

  4.   

    update t_icitemcore
    set fmodel = t.FName + t.FHelpcode + m.f_103
    from t_icitemcore t , t_ICitem m
    where t.FItemID = m.FItemID
      

  5.   

    update t1
    set t1.fmodel=t1.FName+t1.FHelpcode+(select F_103 from t_ICitem where FItemID in (select FItemID from t_icitemcore))
      from t_icitemcore t1
     
    这个语句有点问题:
    当更新t_icitemcore的某一个fmodel时,你加上了t_ICitem表中任一个t_icitemcore表中有的FItemID所对应的F_103,换句话说,你的F_103的值是不确定的.这恐怕不行.
    估计楼主是想要这样的效果:
    update t1
    set t1.fmodel=t1.FName+t1.FHelpcode+(select top 1 F_103 from t_ICitem where FItemID=t1.FItemID)
      from t_icitemcore t1这样可能更说得通一些.
      

  6.   

    update t1
    set t1.fmodel=t1.FName+t1.FHelpcode+(select max(F_103) from t_ICitem where FItemID in (select FItemID from t_icitemcore))
      from t_icitemcore t1
      

  7.   

    select FItemID from t_icitemcore
    根源是这个子查询有多个值
      

  8.   

    select F_103 from t_ICitem where FItemID in (select FItemID from t_icitemcore)不止返回了一条数据
      

  9.   

    FItemID是系统的ID号是唯一的。
      

  10.   

    windows 7 or windows 2008 ?
      

  11.   

    update t1
    set t1.fmodel=t1.FName+t1.FHelpcode+(select F_103 from t_ICitem where FItemID =(select max(FItemID) from t_icitemcore))
      from t_icitemcore t1