DECLARE tableName VARCHAR (64) the DEFAULT CONCAT (' haha ', '_', DATE_FORMAT (DATE_SUB (NOW (), 2 MONTH INTERVAL), '% % m Y'));
The SET @ sql1=CONCAT (' CREATE TABLE ', the tableName, '(
A varchar (64) NOT NULL DEFAULT \ '\' COMMENT \ 'a \',
B varchar (32) NOT NULL DEFAULT \ '\' COMMENT \ 'b \',
C a datetime NOT NULL COMMENT \ '\' c,
D a decimal (12, 4) NOT NULL COMMENT \ 'd \',
E a datetime NOT NULL COMMENT \ '\' e,
PRIMARY KEY (a, b, e),
The KEY idx_meter_id (a) USING HASH,
The KEY idx_collect_time (c) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=\ 'haha \'; '
);
Ask why ladies and gentlemen, the stored procedure to create this table is not successful