Skip to content
Advertisement

Tag: arrays

SQL how to convert array to values for use in IN clause

Working in Postgres SQL: My query argument comes in as a comma separated string: ‘ABC,BCD’ I am trying to construct the query below, but getting an error: ERROR: Operator does not exist: character varying = text[] My question is how to convert ‘ABC,BCD’ to a list of values to use in the IN CLAUSE. Prefer answer in SQL query, not

JSONB sort aggregation

I found this query that suits my needs thanks to this answer here in order to sort fields of data in a JSON document. (Fake, generated random data) SELECT jsonb_agg(elem) FROM ( SELECT * FROM …

Array operation on hive collect_set

I am working on hive on large dataset, I have table with colum array and the content of the colum is as follows. [“20190302Prod4” “20190303Prod1” “20190303Prod4” “20190304Prod4” “20190305Prod3” “…

Advertisement