.
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
1) Depends how are you defining "new"
2) Depends how are you defining "popular"
3)
SELECT bi.id, b.name, bi.dateissued
FROM mdl_badge b
INNER JOIN mdl_badge_issued bi ON bi.badgeid = b.id
WHERE bi.userid = IDNUMBERHERE
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
Thanks conn ..
1)new means based on the timestamps that is one day and second one popular means based on the number of enrollments to the course..
--Bhavani
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
Hello Everyone i have written a query for fetching newly added course based on the time stamp. Please let me know if i need to make any changes..
SELECT fullname
FROM mdl_course
ORDER BY timecreated ASC limit 2 ;
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
Well, other than the LIMIT 2 means it will only show you the last 2 courses...
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
yes richard... is there any method to limit on days...
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
SELECT id, fullname FROM mdl_course WHERE timecreated > UNIX_TIMESTAMP(CURRENT_TIMESTAMP - INTERVAL 4 DAY) ORDER BY timecreated ASC;
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
Thanks Darko, I am searching a query that retrieves the popular courses names based on the number of enrollments to the courses. can i get a guidance on this ?
Re: I am searching answer for below queries..let me know these queries. 1)List of newly added courses. 2)List of popular courses. 3)List of badges earned by the particular user.
Hello Everyone,
I am trying with the below query for retrieving the popular courses based on the number of enrollments to the courses. someone please check this query where i am going wrong.
select c.fullname,count(e.courseid) from mdl_course c,mdl_enrol e where c.id=e.id group by e.courseid,c.fullname ;