I'm written a "movie" program in VB.NET
Users will be able to create custom filters where they can specify which movies they want to see in a list based on some simple things like genre, director, release year etc.
Table movie's:
ID Title Director Year Genres Description Image
Since a movie (or tv show) can have more genres I ended up with storing the the genres into 1 string with a ; as delimiter.
Example:
a01;a02;b08;c01
Of course my application converts a01 to the appropriate "Horror" or "Thriller" genre etc. etc. on retrieving the results.
My question is: is it possible to create a SQLite query that does the filtering itself? At the moment I'm creating queries like:
SELECT *
FROM `movies`
WHERE (`Year` = 2013)
AND (`Genres` LIKE '%a02%' OR `Genres` LIKE '%g05%')
This does the trick, however based on some custom filters, you can end up with queries over 10kb of chars.
Is there some sort of SPLIT function in SQLite so that I could query like this:
SELECT *
FROM `movies`
WHERE (`Year` = '2013')
AND (SPLIT(`Genres`,';') IN ('a01','v05','c01'))
Any help would be very appreciated