I have two tables, one with appointment records and a field called ref_ID. I have a second table also with ref_ID. I've joined the two. My problem is the second table has multiple records with the same ref_ID and I only want to grab one of them. How can I do this.
FROM vwGenPatApptInfo LEFT OUTER JOIN
PM.vwRefDrList ON vwGenPatApptInfo.Appt_Refer_Dr_ID = PM.vwRefDrList.RefDrID
WHERE (vwGenPatApptInfo.Appt_DateTime BETWEEN CONVERT(DATETIME, '2015-04-01 00:00:00', 102) AND CONVERT(DATETIME, '2015-4-10 00:00:00', 102)) AND
(vwGenPatApptInfo.Appt_Status = 'A') AND (vwGenPatApptInfo.Appt_Type_Abbr IN ('BOTOX', 'CONSLT20', ))
ORDER BY vwGenPatApptInfo.Appt_Refer_Dr_Abbr, vwGenPatApptInfo.Appt_DateTime