Ich habe diese SQL fidde.Kann keine Werte in MYSQL Tabelle einfügen
Ich schaffe diese Tabelle:
CREATE TABLE `hydrants log` (
`TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`ID` int(8) NOT NULL,
`TRIG` int(1) NOT NULL,
`VALUE` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Und diese Ansicht:
CREATE ALGORITHM=UNDEFINED VIEW `hydrants_log_maxtime`
AS select `hydrants log`.`ID` AS `id`,`hydrants log`.`TRIG` AS `trig`,`hydrants log`.`VALUE` AS `value`,max(`hydrants log`.`TIME`) AS `time` from `hydrants log` group by `hydrants log`.`ID`;
Nach dem Schema in Geige erstellt oben Ich versuche, diese Zeilen in Hydranten einfügen log Tabelle:
insert into `hydrants log` values ('2016-05-23 10:24:17',5,7,8);
insert into `hydrants log` values ('2016-05-23 10:24:17',6,7,8);
insert into `hydrants log` values ('2016-05-23 10:24:17',7,7,8);
insert into `hydrants log` values ('2016-05-23 10:24:17',8,7,8);
Aber wenn ich versuche, Zeilen oben einzufügen, bekomme ich die folgenden Flügel Fehler:
Es scheint, dass ich etwas falsch mache.
Irgendeine Idee, was ich in dieser Einfügunganweisung falsch mache?