There are many sample queries here:
https://docs.moodle.org/32/en/ad-hoc_contributed_reports
One of these examples may help you.
There are many sample queries here:
https://docs.moodle.org/32/en/ad-hoc_contributed_reports
One of these examples may help you.