일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Python
- math
- array
- PANDAS
- Java
- django
- 파이썬
- Excel
- Presto
- SQL
- list
- matplotlib
- hive
- google apps script
- Redshift
- Tkinter
- Github
- numpy
- PySpark
- PostgreSQL
- Google Excel
- GIT
- gas
- string
- Kotlin
- c#
- Google Spreadsheet
- Apache
- dataframe
- Today
- Total
목록SQL (132)
달나라 노트
Syntaxdate_trunc('datepart', date/timestamp)date_trunc 함수는 위처럼 사용할 수 있습니다.주어진 date를 명시한 datepart까지만 남기고 그 이하는 모두 자른 후(모두 가장 작은 값으로 만든 후) timestamp를 반환합니다. select current_timestamp as current_dttm --> 2025-09-18 03:23:12.907 , date_trunc('year', current_timestamp) as trunc_year --> 2025-01-01 00:00:00.000 , date_trunc('quarter', current_timestamp) as trunc_quarter --> 2025-07..
Presto에서 사용할 수 있는 시간 성분을 추출하는 함수를 알아봅시다. Function nameDescriptionhour(datetime)주어진 datetime의 시간(hour)성분을 추출합니다.minute(datetime)주어진 datetime의 분(minute)성분을 추출합니다.second(datetime)주어진 datetime의 초(second)성분을 추출합니다.millisecond(datetime)주어진 datetime의 밀리초(millisecond)성분을 추출합니다. select current_timestamp as current_dttm --> 2025-10-18 03:13:54.561 , hour(current_timestamp) as current_hour -->..
doy, day_of_year함수는 주어진 특정 날짜가 속한 년도에서 주어진 날짜가 몇번째 날짜인지를 나타내줍니다.단순히 해당 날짜의 일을 추출해주는 것과는 다릅니다. Syntaxdoy(datetime)day_of_year(datetime) 주어진 datetime의 년중 일수를 추출합니다.doy 함수와 dady_of_year 함수는 동일합니다. select current_timestamp as current_dttm --> 2025-10-18 03:03:37.996 , doy(current_timestamp) as current_doy --> 291 , day_of_year(current_timestamp) as current_day_of_year --> 291; 예..
dow, day_of_week는 주어진 datetime이 무슨 요일인지를 요일 번호로 추출해줍니다. Syntaxdow(datetime)day_of_week(datetime) 주어진 datetime의 요일을 번호로 추출해줍니다.dow와 day_of_week함수는 동일합니다. 아래 표는 각 요일에 해당하는 숫자입니다.day of weekday of week numberMon1Tue2Wed3Thu4Fri5Sat6Sun7 select current_timestamp as current_dttm --> 2025-10-18 02:40:06.391 , dow(current_timestamp) as current_dow --> 6 , day_of_week(current_timestamp..