Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 | 31 |
Tags
- vscode
- JavaScript
- resource
- grep
- VirtualBox
- lsof
- 네트워크
- Source
- web.xml
- plugin
- profile
- find
- Mac
- netsh
- maVen
- Quartz
- tomcat
- Windows
- Windows 10
- context
- port
- 줄바꿈 문자
- GIT
- import
- Eclipse
- 단축키
- IntelliJ
- bash
- ssh
- xargs
Archives
- Today
- Total
develog
[MySql] 날짜 검색 본문
-- 2019-02-22 일자만 검색
AND REG_TS >= STR_TO_DATE('20190222', '%Y%m%d')
AND REG_TS < DATE_ADD('20190222', INTERVAL 1 DAY)
AND REG_TS >= DATE_ADD('20190222', INTERVAL 0 DAY)
AND REG_TS < DATE_ADD('20190222', INTERVAL 1 DAY)
시작일, 종료일로 검색
select *
from (
select str_to_date('2023-11-13 00:00:00.000', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-13 23:59:59.999', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-14 00:00:00.000', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-14 23:59:59.999', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-15 00:00:00.000', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-15 23:59:59.999', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-16 00:00:00.000', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select str_to_date('2023-11-16 23:59:59.999', '%Y-%m-%d %H:%i:%s.%f') reg_dt union all
select null
) a
where reg_dt is not null
and reg_dt >= str_to_date('2023-11-14', '%Y-%m-%d')
and reg_dt < date_add(str_to_date('2023-11-15', '%Y-%m-%d'), interval 1 day)
order by reg_dt desc
;
'DB > MySQL' 카테고리의 다른 글
[MySql] Database, User, AutoCommit 정보 (0) | 2019.04.04 |
---|---|
[MySQL] console 명령어 (0) | 2019.01.15 |
[MySql] IP 주소 변환, INET_ATON, INET_NTOA (0) | 2017.10.16 |
[MySQL] insert all (0) | 2017.04.13 |
[MySQL] Bind Variables (0) | 2017.03.24 |
Comments