Wondering if someone can help me write a SQL query. I have a table that contains a bunch of patient data. Each patient has a medical record number assigned to a study. Each study has a unique study reference number which is the primary key. Long story short, I need to write a query that returns one line for each unique medical record number with some other data. Basically like this.
SELECT patient_id, patient_name, DOB from table
this is where I get stuck, I need to somehow incorporate some syntax where I only get one entry per unique or distinct patient id. Hopefully that makes sense.