일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- matplotlib
- Kotlin
- list
- numpy
- c#
- Google Excel
- PostgreSQL
- google apps script
- Presto
- Google Spreadsheet
- string
- Redshift
- Github
- Excel
- django
- Python
- PySpark
- dataframe
- Tkinter
- PANDAS
- SQL
- array
- hive
- Java
- 파이썬
- math
- gas
- Apache
- GIT
- Today
- Total
목록SQL (132)
달나라 노트
Presto의 last_day_of_month는 특정 시점에 해당하는 월의 마지막 날짜를 return합니다. Syntaxlast_day_of_month(datetime) 주어진 datetime에 해당하는 월(month)의 마지막 날짜를 return합니다. select current_timestamp as current_dttm --> 2025-10-18 02:40:06.3691 , last_day_of_month(current_timestamp) --> 2025-10-31; 위 예시를 보면 현재 시점은 2025-10-18입니다.last_day_of_month함수는 2025년 10월의 마지막 날인 2025-10-31을 return해줍니다. FYIhttps://prestodb.io..
Presto에서 사용할 수 있는 다양한 날짜 성분 추출 함수를 알아봅시다. 종류가 많으니 표로 정리하겠습니다.Function nameDescriptionyear(datetime)주어진 datetime의 년도를 추출합니다.quarter(datetime)주어진 datetime의 분기를 추출합니다.month(datetime)주어진 datetime의 월을 추출합니다.week(datetime)주어진 datetime의 주차를 추출합니다.(1~53까지의 번호가 return될 수 있습니다.)week_of_year(datetime)주어진 datetime의 1년중 주차를 추출합니다.(week 함수와 동일합니다.)day(datetime)주어진 datetime의 일을 추출합니다.day_of_month(datetime)주어진 ..
date_parse 함수는 어떠한 형태로 적힌 날짜/시간 텍스트를 실제 date/time data로 변환을 해줍니다. Syntaxdate_part(text, format) - textdate/time으로 변환할 대상 text입니다. - formattext가 어떤 pattern으로 적혀있는지를 나타냅니다.format의 패턴과 text가 일치해야 함수가 정상적으로 작동합니다. KeywordMeaning%Y4자리 년도%y2자리 년도%m2자리 월(01~12)%c1자리 월(1~12)%M월 이름(January~December)%b월 이름(Jan~Dec)%d2자리 일(01~31)%e1자리 일(1~31)%H24시 기준 시간(00~23)%h %p12시 기준 시간(1~12)%I %p12시 기준 시간(1~12)%i2자리 분..
Presto에서는 Redshift에서와 비슷한 to_char 함수를 제공합니다.날짜/시간을 텍스트로 바꿔주는 역할을 합니다. Syntaxto_char(datetime, format) - datetimeto_char를 적용할 대상 datetime 값입니다. - format어떠한 Format으로 바꿀지를 나타냅니다.특정한 기호를 이용하여 바꿀 수 있습니다.아래는 날짜 기호를 나타냅니다.KeywordMeaningyyyy4자리 년도yy2자리 년도mm2자리 월(01 ~ 12)dd2자리 일(01~31)hh2424시 기준 시간(00~23)hh12시 기준 시간(1~12)mi2자리 분(00~59)ss2자리 초(00~59) select to_char(current_date, 'yyyymmdd') --> 2025..