mssql은 테이블 정보에 기본값을 getdate()로 할 경우 값이 입력되면 자동으로 현재 일자와 일시가 입력되는데 mysql은 이와 같은 기능을 하는 함수가 있나요?


//----------------------------------------



CREATE TABLE t (ts TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP);
Otherwise — that is, if the TIMESTAMP column is defined to allow NULL values but not using DEFAULT TIMESTAMP, as shown here…

CREATE TABLE t1 (ts TIMESTAMP NULL DEFAULT NULL);
CREATE TABLE t2 (ts TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00');

…then you must explicitly insert a value corresponding to the current date and time. For example:

INSERT INTO t1 VALUES (NOW());
INSERT INTO t2 VALUES (CURRENT_TIMESTAMP);
크리에이티브 커먼즈 라이센스
Creative Commons License
이올린에 북마크하기

Posted by 홍반장

2007/10/11 18:48 2007/10/11 18:48
Response
No Trackback , No Comment
RSS :
http://tcbs17.cafe24.com/tc/rss/response/2712

Trackback URL : http://tcbs17.cafe24.com/tc/trackback/2712

« Previous : 1 : ... 3705 : 3706 : 3707 : 3708 : 3709 : 3710 : 3711 : 3712 : 3713 : ... 6391 : Next »

블로그 이미지

- 홍반장

Archives

Recent Trackbacks

Calendar

«   2024/05   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Statistics Graph

Site Stats

Total hits:
185939
Today:
197
Yesterday:
745