I have a dataset that I contains patient records. There are many records for the same patient. Each record contains details about a visit to the hospital.
I would like to eliminate the records for those patients that do not have thier first visit at the hospital. There is a column called OriginalVisit which is set true for the patients first visit.
Patients that did not have thier first visit at the hospital do not have a record with OrginalVist set true.
So I need a delete statement along the lines of:
Delete from MyTable where "the patient does not have a record with OriginalVisit set true".
Must be easy...