# 创建表格
CREATE TABLE `sales` (
`商品` varchar(200),
`sp码` varchar(200),
`发货数量` smallint,
`出库单价` double,
`出库货值` decimal(30,3),
`仓库` varchar(200),
`城市`varchar(200)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
#导入文件
-- set sql_mode=‘‘;
load data infile ‘C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads\\stock_new.csv‘ into table stock
CHARACTER SET utf8
FIELDS TERMINATED BY ‘,‘
LINES TERMINATED BY ‘\n‘
IGNORE 1 LINES
(sp码,spname,仓库,城市,方舱出库量,wms出库总数量,wms库存量,wms库存成本,wms在途数量);
原文:https://www.cnblogs.com/ivan09/p/14744387.html