I have 2 tables, in the first tabel (Mail_Template) there are 3 columns:
ID | Name | Text
1 | Mail1 | Text12345
2 | Mail2 | Text654adsd
3 | Mail3 | Text64das
4 | Mail56 | T269a8sdfext
in the next table (DB_KD) i have the next columns:
ID | Client| Mail_Temp_ID
1 | Alex | 2,3
2 | Ludi | 1,2,3,4
3 | Max | 4
4 | Elko | 2
What i need is to search for the Client names and for all the coma separated ID´s (Mail_Temp_ID) output the Mail Templates. As an example, if I search for Alex Templates i should get:
ID | Name | Text
2 | Mail2 | Text654adsd
3 | Mail3 | Text64das
Or if I searched for Max i schould get:
As an example, if I search for Alex Templates i should get:
ID | Name | Text
4 | Mail56 | T269a8sdfext
Unfortunatley I was not able to do it so, i have tryd with the "IN" and the "FIND_IN_SET" functions, but unfortunatley nothing works for me. Can you give me some advice how to do it?