Extract keys / values from a nested JSON object stored as string in Presto?
I am getting below payload as string and need to extract all the values for key “id” .
Extract keys / values from a nested JSON object stored as string in Presto?
I am getting below payload as string and need to extract all the values for key “id” .
Sum ordered rows OVER with distinct duplication
This is the data I have:
How to use CASE with CONTAINS and Array Aggregation
I am trying to write a query using a CASE statement that is based off whether a value is in array, but I run into the catch 22 of not including the case statement in the GROUP BY and getting “must be an aggregate expression or appear in GROUP BY clause” or including it in the GROUP BY and getting “GROUP BY clause cannot contain aggregations, window functions or grouping operations” so I know I’m missing something. My query is:
presto sql get string of elements to get first and second items
Have a table which has a column of string type and the data looks like
How to find how many sessions had specific action from JSON column in SQL
I have a table with 2 columns, session_id and json_column. Each row is at session level and json_column has all the event name <> event time stamp a user took during that session. event names are not repeated so it will have one event time stamp for each event name. For example lets assume the table has only 2 rows and json_column value will look like this for those rows,
Picking just a single value from Map of Arrays in SQL
This is SQL query.
Picking just a single value from Map of Arrays
Let’s assume that you have column having the data type map of arrays
Checking if a string col is a subset of another in Presto
I want to know if column a (VARCHAR) is contained within column B (VARCHAR), e.g. foo
in foobar
. I thought I could do
PreSQL contains semicolons
I executed the following code and found the following issues:
select regexp_replace(e,’;’) as d1