Details
Description
I was executing a lot of cron scripts while playing with another bugs and then, sometimes, I've got this errror, related to tags:
ERROR: column "nr" does not exist
SELECT tb.tagid , COUNT
AS nr FROM mdl_tag_instance ta INNER JOIN mdl_tag_instance tb ON ta.itemid = tb.itemid WHERE ta.tagid = 1 AND tb.tagid != 1 GROUP BY tb.tagid HAVING nr > 2 ORDER BY nr DESC
line 686 of lib/dmllib.php: call to debugging()
line 966 of lib/dmllib.php: call to get_recordset_sql()
line 775 of tag/lib.php: call to get_records_sql()
line 807 of tag/lib.php: call to tag_compute_correlations()
line 369 of admin/cron.php: call to tag_cron()
Using PostgreSQL (not tested under other DBs)
Ciao ![]()
pg does not support aliases in ORDER BY, right?
--> ORDER BY COUNT
DESC