What SQL to Use in Custom SQL

Re: What SQL to Use in Custom SQL

by Ken St. John -
Number of replies: 0

Well here is the final code - I'm still trying to figure out how to get it over to the ad hoc area ....


Show a count of the number of completed courses by user;

SELECT u.lastname, u.firstname,
COUNT(p.timecompleted) AS TotalCompletions
FROM prefix_course_completions AS p
JOIN prefix_user AS u ON p.userid = u.id
GROUP BY p.userid
ORDER BY u.lastname