일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- string
- gas
- Github
- PANDAS
- Tkinter
- dataframe
- google apps script
- Google Excel
- 파이썬
- Kotlin
- array
- Redshift
- matplotlib
- PostgreSQL
- c#
- PySpark
- hive
- SQL
- math
- Apache
- list
- Java
- Mac
- Google Spreadsheet
- numpy
- GIT
- Excel
- Python
- django
- Today
- Total
목록SQL (123)
달나라 노트
Syntax dayofmonth(date_string/timestamp_string) -> 주어진 일자에 대해 일을 return합니다. dayofweek(date_string/timestamp_string) -> 주어진 일자에 대해 요일 번호를 return합니다. weekofyear(date_string/timestamp_string) -> 주어진 일자에 대해 weeknumber를 return합니다. select dayofmonth('2020-11-10') --> 10 , dayofmonth('2020-11-10 12:34:56') --> 10 ; - dayofmonth('2020-11-10') 2020-11-10에서 일(day)을 추출합니다. 따라서 10이 return됩니다. - dayofmonth('..
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..