--SQLï¼
CREATE TABLE test(
i_a int NOT NULL DEFAULT 1,
ts_b timestamp NOT NULL DEFAULT NOW(),
c_c char(2) NOT NULL DEFAULT '1'
);
intç±»åï¼é»è®¤å¼ä¹å¾æ¯æ´åï¼å¹¶ä¸defaultåè¾¹ä¸è¦()æ¬å·ã
charç±»åï¼é»è®¤å¼ä½¿ç¨åå¼å·ã
DATETIMEç±»åï¼NOW()å½æ°ä»¥'YYYY-MM-DD HH:MM:SS'è¿åå½åçæ¥ææ¶é´ï¼å¯ä»¥ç´æ¥åå°DATETIMEå段ä¸ãä¸æ¯æ使ç¨ç³»ç»é»è®¤å¼ã
DATEç±»åï¼CURDATE()以'YYYY-MM-DD'çæ ¼å¼è¿åä»å¤©çæ¥æï¼å¯ä»¥ç´æ¥åå°DATEå段ä¸ãä¸æ¯æ使ç¨ç³»ç»é»è®¤å¼ã
TIMEç±»åï¼CURTIME()以'HH:MM:SS'çæ ¼å¼è¿åå½åçæ¶é´ï¼å¯ä»¥ç´æ¥åå°TIMEå段ä¸ãä¸æ¯æ使ç¨ç³»ç»é»è®¤å¼ã
温馨提示:答案为网友推荐,仅供参考