일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SQL
- PostgreSQL
- Java
- numpy
- string
- dataframe
- Redshift
- GIT
- math
- 파이썬
- list
- Kotlin
- c#
- Python
- Apache
- matplotlib
- gas
- Mac
- google apps script
- PySpark
- Excel
- Google Excel
- Google Spreadsheet
- django
- array
- hive
- PANDAS
- Tkinter
- Github
- Today
- Total
목록SQL (123)
달나라 노트
RANK() OVER() 예시 테이블 Table Name : salary_list id part name salary 1 First_Part One 1000 2 First_Part Two 1900 3 First_Part Three 1400 4 First_Part Four 1700 5 First_Part Five 1400 6 Second_Part Six 1900 7 Second_Part Seven 1200 8 Second_Part Eight 1200 9 Second_Part Nine 1200 10 Second_Part Ten 1300 SELECT *, RANK() OVER(ORDER BY salary DESC) AS rank FROM salary_list Result Set id part name sala..
replace(text, old_text, new_text); text에서 old_text를 new_text로 변환합니다. select replace('123abc123', '1', 'z'); -> 결과 : z23abcz23
truncate table talbe_name; 위 구문은 table_name이라는 이름의 테이블 속 데이터를 모두 삭제합니다. (table 속 데이터만 없어지는 것이고 table 자체와 해당 table에 존재했던 컬럼들은 보존됩니다.)
delete from syntax delete from table_name where condition; table_name이라는 table에서 명시한 condition이 True인 행(row)들을 삭제합니다. delete from test_table where dy > 20201110; 위처럼 적게되면 test_table에 있는 dy컬럼의 데이터가 20201120보다 큰 값을 가진 행(row)을 모두 삭제하게됩니다. delete from test_table; 만약 조건을 명시하지 않는다면 해당 테이블의 모든 데이터가 지워집니다.(단, 테이블은 그대로 남아있습니다.) insert into syntax insert into table_name values (value1, value2, ...) ; inse..