自從那天靈感突現,搜了下MySQL存儲過程的實現,我就不再會爲造測試數據這種事情煩惱了,存儲過程用起來簡直太方便了。測試
DROP PROCEDURE IF EXISTS insert2pay; DELIMITER $ create procedure insert2pay() begin declare i int default 1501; while i <= 6000 do insert into anypay.pay (merchant_id, merchant_no, merchant_channel_id, merchant_name, order_no, outer_no, tracking_number) values (1, '123', 1, 'lktz', concat('odn190611', i), concat('otn190611', i), '1231231235'); set i = i + 1; end while; end $ call insert2pay();