I am an average in database operation but I never deal with a database having values in comma separated manner. As I want the result from both table.
I have one table "Form table"
+------+-----------------+
| id | Fname |
+------+-----------------+
| 1 | BH01101,BH01102 |
| 2 | f_934_tarun2 |
| 3 | f_934,T_3234 |
+------+-----------------+
2nd table "user assigned form table"
+------+--------------------------------+
| u_id | Fname |
+------+--------------------------------+
| 1 | BH01102,BH16101,BH16102,BH16 |
| 2 | f_934_tar,f_934_fhh |
| 3 | f_934_ttt,T_3234 |
| 4 | f_934_a1,BH01102 |
+------+--------------------------------+
I want to get all user ids who has any of form listed in form table. So here the output will be:
+------+
| u_id |
+------+
| 1 |
| 3 |
| 4 |
+------+
Every help will be appreciated.
CREATE TABLE/INSERT
would be helpful