Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...