我们可以使用 SQL 查询向 AWS Athena 中的现有表添加列吗?

0

【以下的问题经过翻译处理】 我在 AWS Athena 中有一个表,其中包含 2 条记录。是否可以用SQL 查询将新列插入到表中?

profile picture
ESPERTO
posta 5 mesi fa15 visualizzazioni
1 Risposta
0

【以下的回答经过翻译处理】 您可以在 Athena 文档中找到有关向表中添加列的更多信息

或者你可以使用 CTAS

例如,您有一张表

CREATE EXTERNAL TABLE sample_test( id string) LOCATION 's3://bucket/path' and you can create another table from sample_test with the query

CREATE TABLE new_test AS SELECT *, 'new' AS new_col FROM sample_test

您可以在 AS 之后使用任何可用的查询

profile picture
ESPERTO
con risposta 5 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande