I have two tables, event and person_involved. Person_involved can have more than one record to one event record. Person_involved table could be (not necessarily will be) patient, witness, physician, other, etc.
I need to create a view that would display the record in event table and the record(s) in person_involved. I need one record that would list the event, patient, physician and witness. My current SQL statement results in three records for my one event.
SELECT event.a, event.b, Patient.a, Patient.b, Physician.a,
Physician.b, Witness.a, Witness.b
FROM Event, Person_Involved as Patient, Person_Involved as
Physician, Person_Involved as Witness
WHERE event.event_id = Patient.event_id
AND event.event_id = Physician.event_id
AND event.event_id = Witness.event_id
I need to create a view that would display the record in event table and the record(s) in person_involved. I need one record that would list the event, patient, physician and witness. My current SQL statement results in three records for my one event.
SELECT event.a, event.b, Patient.a, Patient.b, Physician.a,
Physician.b, Witness.a, Witness.b
FROM Event, Person_Involved as Patient, Person_Involved as
Physician, Person_Involved as Witness
WHERE event.event_id = Patient.event_id
AND event.event_id = Physician.event_id
AND event.event_id = Witness.event_id