PostgreSQL to join Array column

This is the PostgreSQL to pull all the Rules and associated Journey information for a single journeyid. Learned how to join an array column (actions.rules) from Gary Seiling’s website.

SELECT
    *
FROM rules
JOIN actions
  ON rules.ruleid = ANY (actions.rules)
JOIN journeys
  USING (journeyid)
WHERE journeyid=20213

Leave a Reply

Your email address will not be published. Required fields are marked *