1、创建数据库表

--创建线路表
CREATE TABLE IF NOT EXISTS `sys_line` (
  `line_id` VARCHAR(50) NOT NULL,
  `line_name` VARCHAR(50),
  PRIMARY KEY (`line_id`)
);

1、导出数据库数据

CALL CSVWRITE('sys_line.csv', 'SELECT * FROM sys_line');

2、导入数据库数据

insert into sys_line (select * from csvread('D:/soft/H2/bin/sys_line.csv'));

CREATE TABLE sys_line AS SELECT * FROM CSVREAD('D:/soft/H2/bin/sys_line.csv','LINE_ID|LINE_NAME', 'charset=UTF-8 fieldSeparator=|');

update sys_device t1 set t1.tower_id = (select t2.tower_id from sys_tower t2 where t1.line_id = t2.line_id and t1.tower_id = t2.tower_name) where t1.tower_id like '%#%'

恒不动
105 声望15 粉丝