https://mode.com/blog/date-trunc-sql-timestamp-function-count-on/
date_trunc는 postgresql에 해당, my sql에서 가장 비슷한거는 extract임
DATE_TRUNC: SQL Timestamp Function Explained | Mode
Learn how to use Date_Trunc in SQL to round a timestamp to the interval you need. Aggregate time-based data with this helpful function. Examples included.
mode.com
https://walkingfox.tistory.com/175
[MySQL] date_trunc 함수를 구현하자.
date_trunc 라는 함수는 특정일자의 시작이 되는 unit 의 첫날을 가져오는 함수이다. 예를 들면 date_trunc('week', '2022-08-05') 라고 하면 2022년 8월 5일이 있는 주(unit) 의 첫날인 '2022-08-01' 보여준다. date_trun
walkingfox.tistory.com
상용 데이터에서는 쿼리를 할 때 날짜가 찍혀있는 로그 데이터 같은 거라면 특히나 더 ! 날짜 기간을 특정해주는 것이 정말 중요하다.
MY SQL
REGEXP ( | | )
'Study > SQL' 카테고리의 다른 글
Window Function 예제 (0) | 2023.11.16 |
---|---|
SUB QUERY 예제 (0) | 2023.10.23 |
SQL : Delete (0) | 2023.10.05 |
SQL : Update (0) | 2023.10.05 |
SQL : Insert (0) | 2023.10.05 |