colleges table bellow
| ID | Name | Courses |
|---|---|---|
| 1 | ABC | 1,2,3,4,5 |
CourseID = 1;
q = "SELECT * FROM colleges WHERE Courses = CourseID";
that ID is an (int) value but I have some comma-separated values in the Courses column.
is there any way in SQL to solve this problem
>Solution :
You should fix your table design and never store data as comma separated.
You could use FIND_IN_SET
SELECT * FROM colleges where FIND_IN_SET(1, Courses);