Rajarajan

Rajarajan

  • NA
  • 14
  • 11.8k

Compare single value with comma seperated column

Apr 22 2015 7:18 AM

I have two tables - tblpatients and tbldoctor, Both table have unique fields namely patient_id and doctor_id, Here a single patient can get treatment from more than one doctor, So I am storing the doctor_id data from tbldoctor table  to tblpatients table, For eg 2,3

Now I need to compare doctor_id field in both the table to get the details of patient for whom doctor given treatment, like doctor_id=doctor_id

But As I am stroing doctor_id field in tblpatients  as comma separated, I am not getting any result

Please give a solution to achieve this



Answers (3)