type:: [[Function/Aggregate Function]] - [[Example]] collapsed:: true - ```sparql PREFIX foaf: PREFIX foaf: PREFIX dbo: SELECT ?author (COUNT (DISTINCT ?work) AS ?NumberOfWorks) WHERE { ?work a dbo:Artwork . ?work dbo:author ?author . } GROUP BY ?author HAVING (COUNT (DISTINCT ?work) > 50) ORDER BY DESC(?NumberOfWorks) ``` #Query #[[GROUP BY]] #[[ORDER BY]] #DESC