User Hits in Courses Separated by Category

User Hits in Courses Separated by Category

by Daniel Willshaw -
Number of replies: 0

Hi all,


I would like a count for user hits of courses, but then filtered by the category that they are in. 


So count the hits on courses that are located in a certain category?


Can anybody help with this?


I have the SQL query here that counts the course hits, but it is all courses, not separated by categories:


SELECT COUNT(l.id) hits, l.course courseId, c.fullname coursename

FROM prefix_log l INNER JOIN prefix_course c ON l.course = c.id

GROUP BY courseId

ORDER BY hits DESC


thanks.


Average of ratings: -