일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Redshift
- math
- google apps script
- Excel
- SQL
- matplotlib
- numpy
- dataframe
- string
- Apache
- list
- c#
- Github
- GIT
- gas
- Tkinter
- hive
- Python
- Google Spreadsheet
- PostgreSQL
- array
- django
- Java
- Kotlin
- 파이썬
- PANDAS
- Presto
- PySpark
- Google Excel
- Today
- Total
목록SQL (132)
달나라 노트
GREATEST Syntax GREATEST(exp1, exp2, ...) GREATEST 함수는 여러 exp중 가장 큰 값을 return합니다. exp는 column name일 수도 있고 특정 값일수도 있습니다. table name = products product_no category_no price 1250 10 10000 3028 10 8000 2075 10 7000 5217 10 12000 4203 20 11000 3356 20 5500 2103 20 3030 4301 20 6040 8043 30 1010 3356 30 5500 9034 30 9040 1234 30 6500 SELECT product_no, category_no, price, GREATEST(price, 5000) AS temp..
- S3를 이용하는 구문들에 대한 설명은 아래 링크 참조 S3 server에 data 올리기 (csv format) = https://cosmosproject.tistory.com/176 Redshift : unload & copy (s3 서버에 query 결과 upload하기, s3서버에서 파일 불러와 database table 만들기. CSV redshift의 unload 구문은 query결과를 s3 서버에 파일의 형식으로 업로드할 수 있게 해줍니다. copy 구문은 반대로 s3 서버에 있는 파일을 불러와 database 내의 table로 만들 수 있도록 해줍니다. 예시를 보 cosmosproject.tistory.com 이번에는 parquet format을 이용해서 Redshift, Hive등의 d..
drop view if exists test_temporary_table; create temporary view test_temporary_table as select current_date ; select * from test_temporary_table ; -> 결과 : 2020-12-17 drop view if exists test_temporary_table; drop view view_name은 어떤 이름의 view를 삭제하는데 사용됩니다. 여기에 if exists라는 키워드를 붙이면 해당 view가 존재한다면 삭제하고 존재하지않는다면 그냥 넘어가게됩니다. 즉, 존재하지 않는 view를 drop하려할 때 생기는 에러를 방지할 수 있죠. create temporary view test_tempo..
일반적으로 drop table (if exists) 위처럼 drop table 구문을 사용하면 table이 drop되긴 하지만 휴지통 directory에 해당 table이 이동되며 drop된 table을 복구할 수 있습니다. drop table (if exists) purge 그런데 위처럼 drop table 구문의 가장 끝에 purge를 적어주면 table drop 시에 휴지통 directory로 이동하지 않고 완전히 table이 삭제되며 이 경우 table 복구가 불가능합니다.