bobicles2 Posted May 5, 2010 Share Posted May 5, 2010 This is my table Admissions - ID , Patient_Name, Institute_Name, Ward, Surgeon, Date im trying to find out which patients have been admitted to the same ward more than once....so Patient_Name and Ward need to both occur more than once and display. i think i need to use COUNT and HAVING but really unsure of how to tackle this Query Thanks Rob Link to comment https://forums.phpfreaks.com/topic/200805-find-multiple-entries/ Share on other sites More sharing options...
andrewgauger Posted May 6, 2010 Share Posted May 6, 2010 select a.Patient_Name from Admissions a JOIN Admissions b ON a.Patient_Name = b.Patient_Name AND a.Ward = b.Ward AND a.ID != b.ID HAVING COUNT is great for 1 column of equality Link to comment https://forums.phpfreaks.com/topic/200805-find-multiple-entries/#findComment-1053988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.