I have two tables with the following structure:
entities
- id (int),
- name (text)
activity_status
- id (int)
- is_active (boolean)
- entities_ids (int[])
the activity status table contains only two records, with activity of True and False respectively, and the entities_ids is an array of entities that are either active or not, something like this:
SELECT * FROM activity_status
Query result:
1 True [1, 5, 20, 66]
2 False [15, 77, 30]
I need to create a SELECT
statement to get the active entities' names from these tables instead of the IDs.