Contents

System/OS
2013.04.23 12:23

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

조회 수 11684 댓글 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
번호 분류 제목 글쓴이 날짜 조회 수
265 Develop [Android Error] The number of method references in a .dex file cannot exceed 64K hooni 2016.11.10 5495
264 Develop [ios] AES256 알고리즘을 이용해 데이터 암호화/복호화 방법 file hooni 2015.07.21 5467
263 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 5463
262 Develop [android] 초간단 얼럿 (AlertDialog) hooni 2016.10.21 5457
261 Database [mysql] 중복데이터 삭제하는 초간단 쿼리 hooni 2017.11.22 5421
260 Develop [ios] iOS 7 이상 UIBarButtonItem 여백 file hooni 2014.03.27 5390
259 Develop What is difference between Get, Post, Put and Delete? hooni 2018.02.28 5346
258 Develop [ios] 앱딜리게이트 라이프사이클 (AppDelegate Lifecycle) file hooni 2014.05.09 5345
257 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 5340
256 Develop [ios][swift] 초간단 TableView 샘플 file hooni 2016.06.27 5293
255 Develop [ios] URL Scheme 이용하여 앱 설치 확인 hooni 2014.03.10 5292
254 Develop [ios] iOS 의 인앱구매 소개 file hooni 2014.04.29 5262
Board Pagination Prev 1 ... 72 73 74 75 76 77 78 79 80 81 ... 99 Next
/ 99