如何重命名 AWS Athena 输出 csv 中的列?

发布于 2025-01-17 00:51:58 字数 325 浏览 1 评论 0原文

我想替换 Athena 查询输出中的列名称。我无法更改数据库中的名称。可以直接重命名吗?

case when kpi in ('Brand Searches') then replace('Total Searches','Brand Searches') end

这是输出:

KPI                  _col7                
Brand Searches       Total Searches

创建了一个新列,我只想重命名该列。有简单的出路吗?

谢谢。

I want to replace a column name in output of Athena query. I can not change the name in the database. Is it possible to rename it directly?

case when kpi in ('Brand Searches') then replace('Total Searches','Brand Searches') end

Here is the output:

KPI                  _col7                
Brand Searches       Total Searches

A new column was created, I want only to rename the column. Is there an easy way out?

Thank you.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

も让我眼熟你 2025-01-24 00:51:58

您可以将该列别名为您选择的名称:

select count(*) as "number of counts" from ...

You can alias the column to the name of your choice:

select count(*) as "number of counts" from ...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文