Contents

System/OS
2013.04.23 12:23

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

조회 수 10773 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
현재 시간을 타임스템프로 출력하는 구문
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
번호 분류 제목 글쓴이 날짜 조회 수
82 System/OS [doc] 네트워크 장비와 라우터 설정 방법 발표 자료 file hooni 2013.04.23 14493
81 System/OS [mac] SVN 1.8 업데이트 방법 hooni 2013.09.24 14563
80 System/OS [linux] 아파치설치/설정(CGI부분) hooni 2003.04.23 14568
79 System/OS [linux] sendmail 설정/사용 hooni 2003.04.23 14570
78 System/OS [linux] 리눅스 활용 팁^^ hooni 2003.04.23 14629
77 System/OS [linux] 랜카드 2개 설정 & iptables 로 사설 ip.. hooni 2003.04.23 14734
76 System/OS [sql] 중복데이터 삭제 쿼리 hooni 2013.04.23 14734
75 System/OS [linux] 웹로그분석기(webalizer) 설치 & 팁 hooni 2003.04.23 14882
74 System/OS [linux] 이기종간의 파일 공유(Samba) hooni 2003.04.23 14900
73 System/OS [perl] 펄 환경 설정해야 할거 ㅋㅋ hooni 2003.04.23 14992
72 System/OS [linux] 아파치설치/설정 - 사용인증 hooni 2003.04.23 15085
71 System/OS [linux] 센드메일 동적릴레이 설치 hooni 2003.04.23 15228
Board Pagination Prev 1 ... 6 7 8 9 10 11 12 13 14 15 ... 17 Next
/ 17