일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- SQL
- Java
- GIT
- PANDAS
- array
- Google Excel
- Kotlin
- Python
- Github
- Excel
- gas
- PySpark
- c#
- math
- string
- Google Spreadsheet
- PostgreSQL
- hive
- numpy
- dataframe
- matplotlib
- Tkinter
- Mac
- Apache
- 파이썬
- django
- google apps script
- Redshift
- list
- Today
- Total
목록Redshift (76)
달나라 노트
select *from pg_tables; Redshift에서는 pg_table를 이용하면 database에 있는 table의 종류와 각 tabe의 owner를 알 수 있습니다. 위 쿼리의 output column은 아래 링크를 보면 됩니다.https://www.postgresql.org/docs/8.0/view-pg-tables.html pg_tablesThe view pg_tables provides access to useful information about each table in the database. Table 41-37. pg_tables Columns Name Type References Description schemaname name pg_namespace.nspname name ..
alter table 구문을 이용해서 table에 존재하는 column을 삭제할 수 있습니다. Syntax alter table (table_name) drop column (column_name) (table_name) = 변경 사항을 적용할 table 이름입니다. (column_name) = 삭제할 column의 이름입니다. create table test_schema.test_table ( col1 bigint, col2 varchar(60), col3 date, col4 timestamp ) ; 테스트를 위해 위처럼 test_schema.test_table을 생성합시다. column은 col1, col2, col3, col4 총 4개가 존재합니다. alter table test_schema.tes..
alter table 구문을 이용해서 table에 새로운 컬럼을 추가해봅시다. Syntax alter table (table_name) add (column_name) (data_type) (table_name) = 변경 사항을 적용할 table 이름입니다. (column_name) = 새롭게 추가할 column의 이름입니다. (data_type) = 새롭게 추가할 column의 data type입니다. create table test_schema.test_table ( col1 bigint, col2 varchar(60), col3 date, col4 timestamp ) ; 테스트를 위해 위처럼 test_schema.test_table을 생성합시다. column은 col1, col2, col3, co..
alter table 구문을 이용하면 table에 존재하는 column의 이름을 바꿀 수 있습니다. Syntax alter table (table_name) rename column (original_column_name) to (new_column_name) (table_name) = 변경 내용을 적용할 table 이름 (original_column_name) = 이름을 변경할 기존의 column 이름 (new_column_name) = 변경할 새로운 column 이름 alter table test_schema.test_table rename column col3 to dt_col; 위 예시에 있는 alter table 구문을 실행하면 test_schema.test_table에 있는 col3 컬럼 이름..