I have a database table which looks like this (simplified):
╔════╦══════════════╦═════════╗
║ ID ║ Product ║ Tags ║
╠════╬══════════════╬═════════╣
║ 1 ║ Product1 ║a,1-5,b ║
║ 2 ║ Product2 ║a,6-12,d ║
║ 3 ║ Product3 ║a,20-30,c║
║ 4 ║ Product4 ║b,5-55,a ║
╚════╩══════════════╩═════════╝
The query I'm struggling with should return the results based on Tags
column.
Example
Should return all products that have the a
tag (no matter of the position determined with ,
character) with number scope from 6-21
for the second tag, which represents the years of the ones potentially interested into product.
I'm clueless on how to do this.