excel数据导入mysql
1、在 n3输入
=CONCATENATE("INSERT INTO `assets` (
original_asset_number,
assets_name,
assets_cate,
assets_model,
assets_brand,
lead_department,
lead_party,
Purchase,
pur_date,
equipment_status,
asset_position
) VALUES ('"&A3&"','"&B3&"','"&D3&"','"&E3&"','"&F3&"','"&G3&"','"&H3&"','"&I3&"','"&J3&"','"&K3&"','"&L3&"')")
2、点击 右下角 +号 下拉至数据表结尾
3、生成 多条
INSERT INTO `assets` (
original_asset_number,
assets_name,
assets_cate,
assets_model,
assets_brand,
lead_department,
lead_party,
Purchase,
pur_date,
equipment_status,
asset_position
) VALUES,('G02000016','光电转换器','11','RC112-FE-M','***','***','***','北京*****有限公司','40999','1','中汇B#F11弱电间') 这样得sql语句
4、用文本处理器把多条sql合并
例:
INSERT INTO `assets` (
original_asset_number,
assets_name,
assets_cate,
assets_model,
assets_brand,
lead_department,
lead_party,
Purchase,
pur_date,
equipment_status,
asset_position
) VALUES,('G02000016','*****','11','RC112-FE-M','**','**','**','北京****股份有限公司','40999','1','中汇B#F11弱电间')
,('G02000016','*****','11','RC112-FE-M','**','**','**','北京****股份有限公司','40999','1','中汇B#F11弱电间')
,('G02000016','*****','11','RC112-FE-M','**','**','**','北京****股份有限公司','40999','1','中汇B#F11弱电间')
,('G02000016','*****','11','RC112-FE-M','**','**','**','北京****股份有限公司','40999','1','中汇B#F11弱电间')
5、执行sql
这样就可以把exche 得数据写入MySQL拉。
网友评论