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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/200805-find-multiple-entries/#findComment-1053988 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.