Hi,
I have a single table and it contains 4 columns:
Id|Hospital| Doctor|patient 1 A D1 P11 2 B D6 P61 3 A D2 P21 4 A D1 P12 5 B D7 P71 6 B D6 P62 7 B D6 P63
Doctors are unique to the Hospital. They don't work in other hospitals. Patients are unique to the doctor. They don't visit any other doctor. Each hospital has multiple Doctors.
If you observe there are multiple patients for each doctor.
Now the question is, How can I get "only one patient" related to each doctor? It can be any patient from the record.
I am looking forward to seeing something like this:
Hospital Doctor Patient A D1 P11 A D2 P21 B D6 P61 B D7 P71
How do I get the id also in the above table like:
id Hospital Doctor Patient 1 A D1 P11 3 A D2 P21 2 B D6 P61 5 B D7 P71
Thanks in advance