일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Java
- django
- array
- Apache
- Tkinter
- math
- c#
- dataframe
- GIT
- Github
- PANDAS
- Python
- PostgreSQL
- PySpark
- SQL
- Kotlin
- list
- matplotlib
- 파이썬
- gas
- Mac
- numpy
- string
- google apps script
- Excel
- hive
- Google Spreadsheet
- Redshift
- Google Excel
- Today
- Total
목록SQL (71)
달나라 노트
Database에 존재하는 모든 schema와 각 schema에 대한 정보를 얻기 위해선 아래 쿼리를 사용하면 됩니다. select * from svv_all_schemas ; 그러면 결과로 database_name, schema_name, schema_owner 등 schema에 대한 다양한 정보를 얻을 수 있습니다.
Hive에서 concat() 함수는 여러 문자열을 하나로 이어주는 역할을 합니다. Syntax concat(str1, str2, str3, ...) concat() 함수는 여러 개의 parameter를 받을 수 있습니다. 그리고 string type parameter를 모두 연결해서 str1str2str3... 의 string을 return합니다. select concat('abcde, '_', '@', 'xyz', '123', '%') ; -- Result abcde_@xyz% 위처럼 모든 문자열을 연결해줍니다. select concat('_', cast(123 as string), 'abc') ; -- Result _123abc concat() 함수에 들어가는 모든 parameter는 string t..
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 뿐 ..
두 시점간의 차이가 어느 정도인지를 구하는 방법은 여러 가지가 있겠지만 오늘은 unix_timestamp를 이용해 보겠습니다. unix_timestamp 함수는 어떤 timestamp 또는 timestamp_string을 unix_timestamp로 변환해주는 역할을 합니다. https://cosmosproject.tistory.com/50 Hive : unix_timestamp & from_unixtime (yyyymmdd 형태의 텍스트를 date type으로 바꾸기. 날짜와 unix_timestamp간의 unix_timestamp()의 사용법은 아래와 같습니다. unix_timestamp(날짜를 나타내는 텍스트, 날짜의 형식) 예시를 한번 봐봅시다. select unix_timestamp('2020-..