我想插入一個日期時間在我的表中,但我不明白爲什麼它不工作。我運行下面的查詢:日期時間插入錯誤
DROP TABLE IF EXISTS dynamic_pricing ;
CREATE TABLE dynamic_pricing(
id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
time_start TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
time_stop TIMESTAMP NOT NULL,
change_ratio REAL NOT NULL
-- day_of_week INT(1)
);
INSERT INTO dynamic_pricing(id,time_start,time_stop,change_ratio)
VALUES(1,DATETIME('2000-01-01 00:00:00'),DATETIME('2000-01-01 00:00:02'),2);
我使用this試過,只拿到
ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near '('2000-01-01 00:00:00'),DATETIME('2000-01-01
00:00:02'),2)' at line 2
這有什麼錯此查詢?
是的,那不是功能。我的壞= /。刪除它解決了這個問題 –