일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- array
- Google Spreadsheet
- 파이썬
- hive
- dataframe
- GIT
- django
- Redshift
- PANDAS
- PostgreSQL
- Mac
- google apps script
- SQL
- gas
- Kotlin
- Github
- string
- Apache
- math
- Java
- list
- numpy
- PySpark
- Python
- Excel
- Tkinter
- Google Excel
- c#
- matplotlib
- Today
- Total
목록DATE_ADD (3)
달나라 노트
Presto의 date_add() 함수는 어떤 시점에 특정 시간 간격(년, 월, 일, 분기, 주, 시간, 분, 초, 밀리초)을 더하고 빼는 역할을 해줍니다. Syntax date_add(unit, value, timestamp) - unit 더할 시간 간격의 단위를 의미합니다. year -> 년 month -> 월 day -> 일 quarter -> 분기 week -> 주차 dayofweek -> 요일 hour -> 시 minute -> 분 second -> 초 millisecond -> 밀리초 - value 더할 시간 간격을 의미합니다. 더하고싶으면 양수를 쓰면 되고, 빼고 싶으면 음수를 적으면 됩니다. - timestamp value를 더할 대상이 되는 timestamp입니다. timestamp 뿐 ..
date_add(datepart, interval_value, date/time/timestamp) date_add 함수는 위처럼 사용할 수 있습니다. datepart = 날짜 연산을 할 날짜 단위(e.g. day, week, month, year ...) interval_value = 날짜 연산을 할 시간의 양 date/time/timestamp = 기준 날짜 select current_date; --> 2021-02-22 select date_add('day', 10, current_date); --> 2021-03-04 00:00:00.000000 select date_add('week', 2, current_date); --> 2021-03-08 00:00:00.000000 select date_..
date_add(날짜data/날짜 string, days number) date_sub(날짜data/날짜 string, days number) date_add는 주어진 날짜data/날짜 string에서 days number만큼 더한 날짜를 반환합니다. date_sub은 주어진 날짜data/날짜 string에서 days number만큼 뺀 날짜를 반환합니다. select current_date; 결과 : 2021-08-25 select date_add(current_date, 2); 결과 : 2021-08-27 select date_add(current_date, 30); 결과 : 2021-09-24 select date_sub(current_date, 2); 결과 : 2021-08-23 select da..