Postgres Match All array values to same column with and condition
|Added at||2016-12-21 11:12|
I have table table_a with following columns
I want to search (101, 103) with and conditions similar to IN query with OR condition
let say id is foreign of another table event_categories having relation like this.
so I want to fetch records from table_a based on AND with parent event category, OR within sub-event categories of that parent.
Attached screenshot for more clarification
For example "Art Galleries & Exhibits", "Festivals", "Food & Wine" with AND condition,
All sub-category of "Art Galleries & Exhibits" with OR condition "Art & Craft Workshops" OR "Art & Craft Fairs" OR "Visual Arts" if checked.
Relation table events with event_categories event_id is foreign key of events table