Skip to content

SQL Query to get the count of Json Array

I have the below Json object. How do I get the count of Object Array. { “Model”: [ { “ModelName”: “Test Model”, “Object”: [ { “ID”: 1, “Name”: “ABC” }…

How to parse quotes correctly?

I’m using ANTLR with Presto grammar in order to parse SQL queries. This is the definition of the string I’m using: However, when I have a query like this: it mess things up as it parses : ”’,’ as one string. When I used the following rule instead: I didn’t parse correctly q…

Selection based on multiple conditions

I have a requirement to select Customers based on the Channel and Organisation i.e., the order of selection of Customers should be based on Channel – 10,40,20,30 and all the organisations for that …

Count entries by ranges?

I have a table like so: I need query which returns this: Count of users with this sum of amounts(balance) Answer You have to aggregate twice. The first time to SUM amount for each user. The second time to count the number of users for each amount.