将B表的字段内容插入到A表字段中

update hy_b_hacker as h ,   
(
SELECT (
@rowNO := @rowNo +1
) AS rowno, ip
FROM (

SELECT * 
FROM hy_b_sendlog
GROUP BY ip
)a, (

SELECT @rowNO :=0
)b   )   as  i set h.ip=i.ip where h.id=i.rowno;

  

posted @ 2015-12-24 13:38  jshaibozhong  阅读(388)  评论(0编辑  收藏  举报