Skip to content
Advertisement

Tag: presto

How to get text among in blanket [] (Presto)

How to get the result ‘xxx’ from blanket [ ] in presto. I can’t find the proper regexp to fix my problem Could you help me out? Thank you Answer If you have strings like this: and want to extract substring between square brackets, use this:

SQL CASE WHEN: is there a limit ( in number of characters )? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question I’m using the case when statement to group locations ( starting & destination lat, long ) into 3 regions. Running 1 query for each region

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)

Error while converting timestamp string with timezone (+0000) to Timestamp in Presto

I am trying to convert a timestamp string to timestamp with date_parse, but keep getting an error. Any suggestions? I am working on Presto SQL. I also refered: http://teradata.github.io/presto/docs/127t/functions/datetime.html, but couldnt find anything that can deal with +0000 i.e Timezone. I tried: throws me error Invalid format: “2021-05-22 04:00:00 +0000” is malformed at “+0000″” Also tried this: throws me error

Advertisement