Let's say I have a BOOKS table with the records below below:
The genres field is an array of enum that containes the genre of the book and these are its values: ['adventure', 'horror', 'romance']
Record 1
title: 'Deadlock'
genres: ['Horror']
Record 2
title: 'Sunny Hills'
genres: ['Romance', 'Adventure']
Record3
title: 'Exiled Prince'
genres: ['Adventure']
I did something like this:
SELECT * FROM books WHERE genres = ARRAY['Adventure']::book_genres_enum[]
With the query above, I'm only able to get the 'Exiled Prince' book. With the records above, how do I formulate a query that can get all the records that has Adventure in its genre?