일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- PANDAS
- Github
- Redshift
- 파이썬
- PySpark
- Kotlin
- list
- string
- c#
- SQL
- matplotlib
- gas
- numpy
- google apps script
- Google Excel
- Tkinter
- Java
- Google Spreadsheet
- Excel
- Apache
- hive
- django
- array
- Mac
- math
- dataframe
- PostgreSQL
- GIT
- Python
- Today
- Total
목록분류 전체보기 (832)
달나라 노트
position(text1 in text2) Redshift의 position 함수는 위처럼 사용할 수 있으며 text1을 text2에서 찾아 그 위치를 반환합니다. selectposition('a' in 'abcde') ; - Result 1 selectposition('b' in 'abcde') ; - Result 2 selectposition('c' in 'abcde') ; - Result 3 selectposition('d' in 'abcde') ; - Result 4 selectposition('e' in 'abcde') ; - Result 5 위 예시를 보면 이해가 쉽습니다. a, b, c, d, e라는 각각의 문자를 'abcde'라는 문자열에서 찾아 그 위치를 반환해줍니다. 가장 첫번째 위치..
LISTAGG() LISTAGG() 함수는 동일한 Column에 있는 데이터들 중 여러 Row의 데이터들을 하나의 행으로 합쳐주는 기능을 가집니다. 자세한건 실제 예시를 보시죠. Table name = employees department_no join_dt name 10 2020-02-01 Bero 10 2020-02-02 Alice 10 2020-02-03 Chris 20 2020-02-03 Dave 20 2020-02-02 Filia 20 2020-02-04 Elin 30 2020-02-06 Grace 30 2020-02-04 Irene 30 2020-02-05 Hella LISTAGG(column_name, 'seperator') WITHIN GROUP (ORDER BY column_name) O..
Redshift에선 Regular expression을 이용한 replace 기능을 제공합니다. regexp_replace(old_text, re_exp_pattern, new_text) regexp_replace의 사용법은 위와 같습니다. old_text에서 re_exp_pattern과 일치하는 부분을 찾아 new_text로 바꾸라는 뜻이죠. select regexp_replace('abc@123.com', '@.*\\.com', '') -> abc 반환 , regexp_replace('abc@email.com', '@.*\\.com', '') -> abc 반환 , regexp_replace('abc@email123.com', '@.*\\.com', '') -> abc 반환 ; 위 쿼리의 결과는 모두 ..