jellis Posted May 11, 2007 Share Posted May 11, 2007 Hi all, I've tried searching but have achieved nothing so far. I have a table as follows: - del_id booking fname lname email What I'd like to do is return DISTINCT bookings, but also COUNT how many time bookings are repeated. So the output would return the booking number and how many people on that booking. Thanks ladies and gents. Quote Link to comment https://forums.phpfreaks.com/topic/50896-solved-returning-number-of-occurence-of-distinct-values/ Share on other sites More sharing options...
bubblegum.anarchy Posted May 11, 2007 Share Posted May 11, 2007 SELECT booking, count(*) FROM bookings GROUP BY booking Quote Link to comment https://forums.phpfreaks.com/topic/50896-solved-returning-number-of-occurence-of-distinct-values/#findComment-250325 Share on other sites More sharing options...
jellis Posted May 13, 2007 Author Share Posted May 13, 2007 Wow... that was so much easier than I anticipated. Here I was trying subqueries etc... and the answer was there all along. Thanks a bunch! Quote Link to comment https://forums.phpfreaks.com/topic/50896-solved-returning-number-of-occurence-of-distinct-values/#findComment-252428 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.