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;