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
142 System/OS [linux] root 전환시 패스워드 없이 su 사용하기 hooni 2013.12.22 12685
141 System/OS [linux] CentOS 터미널 언어 설정(한글/영어) hooni 2013.12.22 18513
140 System/OS CentOS 6.5 USB 설치 6 file hooni 2013.12.18 37676
139 System/OS [mac] Charlesproxy 간단한 설정 내용~ hooni 2013.11.12 12325
138 System/OS [linux] 특정 문자열 포함된 파일 찾는 명령어 hooni 2013.10.16 30611
137 System/OS [mac] 맥에서 슬립(잠자기) 모드 진입을 막는 방법~ hooni 2013.10.10 30880
136 System/OS [mac] Mac에서 Mac으로 원격제어하기 (맥에서 맥으로) file hooni 2013.10.08 36989
135 System/OS [linux] 우분투 APM + phpmyadmin 설치 hooni 2013.10.07 49321
134 System/OS [mac] SVN 1.8 업데이트 방법 hooni 2013.09.24 14561
133 System/OS [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리 hooni 2013.07.10 18797
132 System/OS [mysql] MySQL server has gone away 에러 대응 hooni 2013.05.29 19224
131 System/OS Mac OS X - Apache+PHP+MySQL 환경 서버 hooni 2013.04.25 31627
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17