CREATE TABLE mytable (
id int,
user_id text,
changes jsonb,
exercise_entry_id int
);
INSERT INTO mytable VALUES
(1, 'foo', '["a","b"]', 3),
(2, 'foo', '["c","d"]', 3);
Cross join query:
SELECT
mytable.*,
elems
FROM
mytable cross join
jsonb_array_elements(changes) as elems
order by mytable.id;
But this query returns only 4 rows as the picture attached. Cross join should return 8 rows. Now only return 4 rows, what point did i miss?