일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SQL
- Github
- google apps script
- Mac
- Apache
- c#
- dataframe
- 파이썬
- Kotlin
- PANDAS
- Google Spreadsheet
- Java
- matplotlib
- math
- PostgreSQL
- Excel
- numpy
- GIT
- Tkinter
- hive
- PySpark
- array
- Google Excel
- Redshift
- string
- list
- django
- Python
- gas
- Today
- Total
목록SQL (102)
달나라 노트
current_timestamp는 현재 시스템의 시간을 timestamp type으로 return합니다. select current_timestamp -- Result 2023-10-09 18:47:12.970000000
Presto의 date_diff() 함수는 두 시점간의 차이를 원하는 단위(e.g. 시간, 분 등)로 return합니다. Syntax date_diff(unit, start_datetime, end_datetime) - unit 두 시점간의 차이를 어떤 단위로 return할지를 결정합니다. year = 두 시점간의 차이를 년 단위로 계산합니다. month = 두 시점간의 차이를 월 단위로 계산합니다. day = 두 시점간의 차이를 일 단위로 계산합니다. hour = 두 시점간의 차이를 시간 단위로 계산합니다. minute = 두 시점간의 차이를 분 단위로 계산합니다. second = 두 시점간의 차이를 초 단위로 계산합니다. - start_datetime 시작 시점의 datetime입니다. - end_d..
to_timestamp() 함수는 날짜/시간 형태의 문자열이나 timestamp type의 데이터를 받아 원하는 timestampz로 변환합니다. Syntax to_timestamp(timestamp/timestamp_string, format) - timestamp/timestamp_string timestamp로 type을 변환할 대상 timestamp 또는 날짜/시간 형태의 문자열을 전달합니다. - format timestamp/timestamp_string 이 어떤 형태를 가지고 있는지에 대한 pattern을 의미합니다. select to_timestamp('20230101_082739', 'yyyymmdd_HH24MISS') -- Result 2023-01-01 08:27:39.000000 +0..
Redshift의 next_day() 함수는 어떤 timestamp로부터 가장 가까운 미래의 어떤 요일의 날짜를 return해줍니다. Syntax next_day(timestamp, weekday) - timestamp 기준이 되는 날짜시점입니다. - weekday 가장 가까운 미래의 어떤 요일을 의미합니다. 예시로 보는게 더 이해가 빠를겁니다. select current_date --> 2023-09-20 , next_day(current_date, 'mon') as next_mon --> 2023-09-25 , next_day(current_date, 'tue') as next_tue --> 2023-09-26 , next_day(current_date, 'wed') as next_wed --> 20..