能不能用update set select 来填custmer_from的列。值从上一行的custmer_to取。 前提是相同custmer_ID。多谢啦!

解决方案 »

  1.   


    http://i.6.cn/cvbnm/10/f4/c4/d8dd495d39779f7455efeda52bb6d039.png看的到吗?
      

  2.   

    http://i.6.cn/cvbnm/10/f4/c4/d8dd495d39779f7455efeda52bb6d039.png
      

  3.   

    update t5 a, t5 b set a.customer_from = b.customer_to where b.id=a.id-1;但是你的图中,有很多是空的,是你故意留空还是同时要达到那种效果?
      

  4.   


    update userinfo A join userinfo B on A.customer_id=B.customerid_uid
    set A.customer_from=B.customer_to
    where B.id=a.id-1
      

  5.   

    A.customer_from
    B.customer_toA B 指的是什么啊, 是不是2个table
      

  6.   


    B.customerid_uid 还是 B.customer_id