Home > Mobile >  How to rename a column in AWS Athena output csv?
How to rename a column in AWS Athena output csv?

Time:03-25

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.

CodePudding user response:

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

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

  • Related