samedi 3 octobre 2015

how to write COUNT(DISTINCT()) query?

Please help me with this query.

I have a table student which looks like:

*id, name, surname, year, course*
1, John, Johnson, 3, Economy
2, Lara, Croft, 2, Biology
3, Mark, Jones, 3, Economy
4, Jim, Smith, 1, IT
5, Sarah, Kennedy, 1, IT
6, Matt, Damon, 3, Economy

And would like to get as a Result Set all courses with number of students attending, like:

*course, count*
Economy, 3
IT, 2
Biology, 1

Aucun commentaire:

Enregistrer un commentaire