我使用加载数据infile上传CSV文件,如何将行索引设置为特定列。
$max_asset_id = 79;
LOAD DATA LOCAL INFILE '$file'
IGNORE INTO TABLE asset_mgt.asset_info
FIELDS TERMINATED BY ','
ENCLOSED BY '\"'
LINES TERMINATED BY '\n'
(@asset_id, @type_of_asset, @asset_description, @model, @serial_number, @asset_tagging_no, @quanity, @remarks)
SET asset_id = /*Add increment here $max_asset_id++ */,
type_of_asset = @type_of_asset,
asset_description = @asset_description,
model = @model,
serial_number = @serial_number,
asset_tagging_no = @asset_tagging_no,
quanity = @quanity,
remarks = @remarks