Top "Lateral" questions

Query for array elements inside JSON type

I'm trying to test out the json type in PostgreSQL 9.3. I have a json column called data in a table …

sql json postgresql jsonb lateral
Hive lateral view with sample example with hive table having 1 column as array

My use case is I am having one table in hive which has one column as INT and one as …

view hive sample query-by-example lateral
Postgres analogue to CROSS APPLY in SQL Server

I need to migrate SQL queries written for MS SQL Server 2005 to Postgres 9.1. What is the best way to substitute …

sql postgresql postgresql-9.1 cross-apply lateral
Query for element of array in JSON column

Recently upgraded to using PostgreSQL 9.3.1 to leverage the JSONfunctionalities. In my table I have a json type column that has …

sql json postgresql postgresql-9.3 lateral
GROUP BY in Postgres - no equality for JSON data type?

I have the following data in a matches table: 5;{"Id":1,"Teams":[{"Name":"TeamA","Players":[{"Name":"AAA"},{"Name":"BBB"}]},{"Name":"TeamB","…

sql json postgresql greatest-n-per-group lateral
PostgreSQL: Flattening a relation with an array to emit one row per array entry

Given a table defined as such: CREATE TABLE test_values(name TEXT, values INTEGER[]); ...and the following values: | name | values | +…

sql arrays postgresql set-returning-functions lateral
JOIN on set returning function results

I am trying to join table and function which returns rows: SELECT p.id, p.name, f.action, f.amount …

sql postgresql join set-returning-functions lateral
"invalid reference to FROM-clause entry for table" in Postgres query

I have the following query: query = "SELECT data #>> '{id}' AS id, data #>> '{name}…

sql postgresql correlated-subquery jsonb lateral