Is it possible to search for an array of numbers in a comma separated column?
I know that this is possible
SELECT * FROM products WHERE FIND_IN_SET('1', '1,3,5') > 0
But is this possible too?
SELECT * FROM products WHERE FIND_IN_SET('1,2', '1,3,5') > 0
If 1 or 2 be in the column it should return > 0
if you know another method just let me know
thank you
'1,2'. is this possible to normalize this? thank youuser_classtable that has a row per student/class with a studentid field and a classid field, that is, if student1 and student2 both registered for class1 and student1 also registered for class2, you'd have 3 rows,student1 - class1,student2 - class2,student1 - class2. That makes it trivial to - for example - count number of registered students in a class, which is hard with a comma separated list in the student table.