I have table table_a with following columns
id event_id
1 101
1 102
1 103
2 105
2 103
2 106
I and to search (101, 103) with and conditions similar to IN query with OR condition
For example id 1 match both for 101 and 103 event_id;
For this I write following query but it not working.
select * from table_a where event_id = ALL(ARRAY[101,103]);
UPDATED--------------------------- And I have another problem
let say id is foreign of another table event_categories having relation like this.
id parent_id
101 null
102 101
103 101
104 null
105 104
so I want to fetch records from table_a based on AND with parent event category, OR within sub event categories of that parent.
For example 101, 104 with AND 102, 103 within OR of 101