私は現在の日付をデフォルトで、時刻ではないとします。現在の日付
CREATE TABLE Order_T
(OrderID NUMERIC(11) NOT NULL,
OrderDate DATE DEFAULT NOW(),
CustomerID NUMERIC(11),
CONSTRAINT Order_PK PRIMARY KEY (OrderID),
CONSTRAINT Order_FK FOREIGN KEY (CustomerID) REFERENCES Customer_T (CustomerID));
なぜこの日付では機能しないのか分かりません。
デフォルトの日付をタイムスタンプのない現在の日付にしたいとします。
ユースA
トリガーを使用トリガ、この回答を参照してください[http://stackoverflow.com/questions/6283821/how-to-set-default-value-of-mysql-datetime-not-timestamp-to-now-or-current](http:/ /stackoverflow.com/questions/6283821/how-to-set-default-value-of-mysql-datetime-not-timestamp-to-now-or-current) –
MySQL ??本気ですか!?? – Strawberry
[MySQL Datetimeカラムのデフォルト値はどのように設定しますか?](http://stackoverflow.com/questions/168736/how-do-you-set-a-default-value-for-a- mysql-datetime-column) –