Retrieving comma sperated record from sql
I have tree tables in a database
- Student (student_id,first_name,last_name)
- Employee (employee_id,full_name,last_name)
- Message (message_id,sender_id,reciever_ids,msg)
When student/employee sends a message to a students's or employee's reciever_id containt comma spertated value like 1-1,2-45,1-25).
2-45 shows its an employee and 45 is his id and in "1-25" 1 shows its a student and 25 shows its is his id.
now how can i triverse that reciever_ids to get the relevant record?