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

0

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

profile picture
EXPERTO
preguntada hace 5 meses15 visualizaciones
1 Respuesta
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
EXPERTO
respondido hace 5 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas