update a r1 set linkID = 
(select id from
(select t1.*,t1.rowid from a t1 where rowid != (
select max(rowid) from a t2  where t1.name=t2.name and t1.tel = t2.tel)
) t3
where t1.name=t2.name and r1.tel = t3.tel and r1.rowid !=t3.rowid)

解决方案 »

  1.   

    有错啊, ......where t1.name=t2.name and r1.tel = t3.tel and r1.rowid !=t3.rowid)
    提示: t2.name为无效列名,编译通不过啊??????
      

  2.   

    update test r1 set linkID = 
    (select id from
    (select t1.*,t1.rowid from test t1 where rowid != (
    select max(rowid) from test t2  where t1.name=t2.name and t1.tel = t2.tel)
    ) t3
    where r1.tel = t3.tel and r1.rowid !=t3.rowid)我改了一下,现在行了,非常感谢!
      

  3.   

    应该是:
    t1.name=t3.name 和呵呵呵和