System/OS
2013.04.23 12:23
[mysql] 시간 관련 SQL구문..
조회 수 11684 댓글 0
현재 시간을 타임스템프로 출력하는 구문
select now();
select unix_timestamp();
현재 시간을 년-월-일 시간으로 출력하는 구문
select sysdate();
현재 시간을 년월일시.. 모두 붙여서 출력하는 구문
select now()+0;
예를 들어..
select substring(now(), 0, 4);
이 구문을 쓰면 타임스템프의 앞부분 4자리를 가져오지만..
select substring(now()+0, 0, 4);
이 구문을 쓰면 4자리 현재 년도를 가져오게 된다.
-
[mysql] CPU 점유율이 높을 때 확인할 내용
-
[mysql] DB->Text, Text->DB 변환
-
[mysql] ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
-
[mysql] error while loading shared libraries: libmysqlclient.so.10:
-
[mysql] MacOS에 MySQL 설치, 설정, 암호 재설정
-
[mysql] MySql DB/테이블 사이즈 확인을 위한 쿼리
-
[mysql] MySQL server has gone away 에러 대응
-
[mysql] mysql user 생성시 ERROR 1364
-
[mysql] MySQL 데이터베이스 추가 및 사용자 추가
-
[mysql] MySQL 백업 및 복구
-
[mysql] MySql 에서 정렬 후 그룹 하는 방법
-
[mysql] MySQL 한글 깨짐 현상 해결하기(UTF8)