Skip to content
Advertisement

Tag: amazon-athena

Casting Decimal to Currency in AWS Athena

I have a field value(decimal(23, 2)) and I am querying over it like this: sum(value) and as output i get 1200000.32 I am trying to cast it to currency to get $1.200.000,32 like this: How can I get the desired currency type? Answer There is no money type in presto. And Amazon’s version of presto does not support format and

How to parsing Json in AWS Athena?

I want to parse the JSON column in Athena but I have a problem in one column. The column includes an escape character. I don’t know if this problem. I want to reach to Message. You can see below sample data and Message under Return. Thanks This is the JSON. Answer If you take only the object which contains return

Proper Case in Athena SQL

I’m new to Athena and trying to convert a field ‘Country’ to Proper Case. For example: united states -> United States Is there a way to do this in Athena? Answer Turning a comment into an answer: Athena engine version 2 gives in its RegEx section as example for regexp_replace(string, pattern, function)

How to combine multiple records in one in SQL

I have a SQL table that looks something like this: OP ID First name Last name Phone number I 123 John Smith 888-555 U 123 777-555 I have to combine this rows through select query into something like this: ID First name Last name Phone number 123 John Smith 777-555 I have trouble writing query because my only idea is

Advertisement