I need the help from a SQL expert. When I execute the following query I get most of the information I want, that is full completed courses by user in Moodle. The problem is when I add one course column to be shown as a result, for example [login to view URL], records start being duplicated. I suppose it is due to one of my JOIN but I've tried moving them without find the problem. Thank you.
SELECT username, FROM_UNIXTIME([login to view URL], '%d-%m-%Y') AS date_created, [login to view URL]
FROM mdl_user u
JOIN mdl_customcert_issues ON [login to view URL] = [login to view URL]
JOIN mdl_user_enrolments ue ON [login to view URL] = [login to view URL]
JOIN mdl_enrol e ON [login to view URL] = [login to view URL]
JOIN mdl_role_assignments ra ON [login to view URL] = [login to view URL]
JOIN mdl_context ct ON [login to view URL] = [login to view URL] AND [login to view URL] = 50
JOIN mdl_course c ON [login to view URL] = [login to view URL] AND [login to view URL] = [login to view URL]
Hello,
As an expert in SQL, i am very much interested to fix this issue. Can you please show me the issue first? Looking forward to have a positive response from you.
Thanks
Hello
Greetings for the day !!!
As per my understanding there is some issue within Moodle database,so we need to review & fix it.
-> May i have your an SQL database ?
I would like to tell you that I am working on Moodle platform from last 7 years.I have worked on its different versions such as 1.x, 2.x and now 3.x.
Waiting for your reply
Kind Regards
HS Virasat Solutions