Remove Null from For loop of ArrayList

I am currently converting an ArrayList to a String to send it to a DB so I can retrieve it on the other end and convert it back to an ArrayList later. My thought process is to convert it to a string …

PostgreSQL array overlap with the ALL construct

I want to achieve the same behavior as in next example: select array[1, 3] && array[1] and array[1, 3] && array[2] using the ALL construct like so: select array[1, 3] && all(…

SQL – select where for specific id, all distinct values for other column exist

I am having a bit of a hard time explaining the logic I want to achieve in the title. Anyway, I have a database containing two tables (rent and car). The car table contains data about cars (license …

How to use LOWER() on elements of a jsonb column in PostgreSQL?

I have a PostgreSQL table like this one: Table t id | keys (jsonb) —+—————- 1 | [“Key1”, “Key2”] My goal is to query this table to find out if one of the keys of a …

postgres – aggregate items in text array

I have an array of text items, each text item in the array is a delimited string, here is a sample: drop table if exists tmp; create table tmp(x text); insert into tmp select (‘1~41.5~50~1|2~43.72~…

How to fetch value from JSON document inside MySQL column?

I have written following MySQL Json Array query. The Mysql version is 8.0.18-commercial select r.network, s.server from table1 e inner join table2 s on e.objectId = s.envId inner …

Postgres jsonb field to array

I was going through the Postgres Jsonb documentation but was unable to find a solution for a small issue I’m having. I’ve got a table : MY_TABLE that has the following columns: User, Name, Data and …

How to query Json array in jsonb in Postgresql

I have a jsonb column which have following rows ROW1: [ { “cpe23Uri”: “cpe:2.3:a:sgi:irix:3.55:*:*:*:*:*:*:*”, “active”: true }, { “…

Standard SQL – How to count frequency of values in array

I get the following Table with the query underneath: SELECT fullVisitorId, COUNT(fullVisitorId) as id_count, ARRAY_AGG(trafficSource.medium) AS trafic_medium FROM `bigquery-public-data….

how to write select query in PostgreSQL to iterate over an array which is returned by a select query

SELECT b_items_p_id FROM public.box WHERE b_id =1 and this is what it returns: {1,3,5} Now on each of these value, i.e., 1, 3 and 5 I want to run another select query: select p_desc from public….