Answer the question
In order to leave comments, you need to log in
ERROR: invalid reference to FROM-clause entry for table "t"?
SELECT c.*, t.id, t.campaign_status_id, t.search, d.list
FROM campaign t, LATERAL (
SELECT array_agg(value::int) AS list
FROM jsonb_array_elements_text(t.search->'tags_in')
) d
LEFT JOIN campaign_status c ON t.campaign_status_id = c.id
where d.list && array[102,83,55]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question