1. 程式人生 > 實用技巧 >消失的兩個數字(1-N缺兩個數)

消失的兩個數字(1-N缺兩個數)

DROP PROCEDURE IF EXISTS proc_initData; -- 如果存在此儲存過程則刪掉
DELIMITER $
CREATE PROCEDURE proc_initData()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=80000 DO

    INSERT INTO `ovp4`.`ovp_car` (`id`, `area_code`, `unit_id`, `org_id`, `use_unit_id`, `use_org_id`, `cost_unit_id`, `cost_org_id`, `service_org_id`, `service_unit_id`, `management_id`, `management_flag`, `plate_no`, `plate_color`, `car_type`, `use_type`, `brand`, `model`, `seat_num`, `color`, `frame_num`, `enginnumber`, `oil_wear`, `exhaust`, `driver_id`, `purchase_date`, `transfer_date`, `purchase_sum`, `init_mileage`, `as_expire`, `car_device_id`, `car_device_num`, `sim_card_num`, `insurance_company_id`, `repair_company_id`, `car_state`, `park_id`, `gas_company_id`, `gas_card_num`, `gas_card_type`, `car_image`, `last_maint_date`, `insurance_expire`, `over_speed`, `is_share`, `last_number`, `is_limit`, `limit_day`, `is_rent`, `can_use`, `fuel_type`, `emission_std`, `is_reserve`, `remark`, `del_flag`, `create_user`, `create_time`, `update_user`, `lut`, `tenant_id`)

VALUES (replace(uuid(), '-', ''), '110100000000', '94b11a4866dd4588a7ceb2dfd47ee2f9', '94b11a4866dd4588a7ceb2dfd47ee2f9', NULL, NULL, NULL, NULL, '5bdd0d58a9d211e98a7c7cd30ab8a961', '5dba16f1a9d211e98a7c7cd30ab8a961', '5dba16f1a9d211e98a7c7cd30ab8a961', '2', CONCAT('TS',LPAD(i,5,'0')), 'blue', '120', 'YWBZYC', '尼桑', NULL, '5', '黃色', NULL, NULL, '10.0', NULL, NULL, NULL, NULL, NULL, '12645.00', '2019-10-06 20:29:25', 'b964f90fbab34fd18ef065d425951a09', '6606521', '1440379159352', NULL, NULL, '1', NULL, NULL, '1000111100011577427', 'CARD_ZSH', '

http://47.94.168.174/resource/upload/2019/08/28/京ABS583-1_20190828155016946.jpg', NULL, NULL, NULL, '0', NULL, NULL, NULL, NULL, '1', NULL, NULL, NULL, NULL, '0', 'c6a84f4eae3e4e9684011b6f89816ca2', '2019-07-19 14:57:39', 'c6a84f4eae3e4e9684011b6f89816ca2', '2019-11-27 15:41:40', '5797');

    SET i = i+1;  
END WHILE;  

END $
CALL proc_initData();