Contents

System/OS
2013.04.23 12:23

[mysql] 시간 관련 SQL구문..

Views 10773 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
현재 시간을 타임스템프로 출력하는 구문
select now();
select unix_timestamp();

현재 시간을 년-월-일 시간으로 출력하는 구문
select sysdate();

현재 시간을 년월일시.. 모두 붙여서 출력하는 구문
select now()+0;


예를 들어..

select substring(now(), 0, 4);
이 구문을 쓰면 타임스템프의 앞부분 4자리를 가져오지만..

select substring(now()+0, 0, 4);
이 구문을 쓰면 4자리 현재 년도를 가져오게 된다.


?

List of Articles
No. Category Subject Author Date Views
94 System/OS [linux] 쉘 환경변수 PS1(프롬프트) hooni 2003.04.23 13492
93 System/OS [linux] ipchains 옵션 hooni 2003.04.23 13611
92 System/OS 아파치(Apache) 인증사용(htaccess)으로 특정 디렉토리에 암호걸기 hooni 2013.04.23 13659
91 System/OS [linux] 셀 스크립트 if, for, case in.. hooni 2003.04.23 13686
90 System/OS [linux] 새 하드디스크 추가하기..(내공쌓기) hooni 2003.04.23 13807
89 System/OS [linux] 터미널에서 문자 깨질 때 설정 ㅋㅋ hooni 2003.04.23 13914
88 System/OS [linux] 기본적인 설정하기(내공쌓기) hooni 2003.04.23 13993
87 System/OS [linux] 아파치설치/설정(모니터링) hooni 2003.04.23 14153
86 System/OS [linux] ssh에서 원격 파일 전송하기.. hooni 2013.04.23 14157
85 System/OS [linux] ipchains 사용예(패킷 필터링) hooni 2003.04.23 14171
84 System/OS [linux] 기본 명령어 (내공쌓기) hooni 2003.04.23 14333
83 System/OS [linux] 아파치설치/설정 hooni 2003.04.23 14492
Board Pagination Prev 1 ... 5 6 7 8 9 10 11 12 13 14 ... 17 Next
/ 17