INSERT INTO t_clear_allot_detail (
id,
parent_id,
asset_code,
fund_no,
trans_date,
repay_type,
repay_time,
order_no,
loan_no,
STATUS,
repay_amt,
allot_amt,
is_valid,
create_time,
update_time,
version,
remark)
SELECT
(SELECT @rownum:=@rownum+1) id ,
parent_id,
asset_code,
fund_no,
trans_date,
repay_type,
repay_time,
order_no,
loan_no,
STATUS,
repay_amt,
allot_amt,
is_valid,
create_time,
update_time,
version,
remark
FROM
t_clear_allot_detail
where id <742701981810651136
limit 8000;
SELECT max(id) from t_clear_allot_detail;
set @rownum=8793814741927768064;
SELECT @rownum:=@rownum+1;
原文:https://www.cnblogs.com/toufajiantuzhongbuhui/p/14422170.html