unixman_again Posted January 17, 2013 Posted January 17, 2013 In MySQL, how do you generate the query from the table shown? It's something to do with COUNT DISTINCT and GROUP BY (I think) but I can get the flippin' thing to work! Thanks! table results that I'd like returned id uid course uid course count 1 122 1 122 1 2 2 122 1 122 2 1 3 122 2 127 1 1 4 127 1 127 2 2 5 127 2 6 127 2
pcstru Posted January 17, 2013 Posted January 17, 2013 select uid, course, count(course) from group by uid,course 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now