Ad-hoc database queries: Problems with Link in Query

Re: Ad-hoc database queries: Problems with Link in Query

by Randy Thornton -
Number of replies: 2
Picture of Documentation writers
Most welcome. Glad that was helpful.

It gave me the chance to finally document how it works. That method makes creating links much quicker than having to fiddle with the html and quotes, etc. But it is non-standard.
In reply to Randy Thornton

Re: Ad-hoc database queries: Problems with Link in Query

by Vicke Denniston -
Picture of Testers
This is excellent, I figured out my query.
Thank you
In reply to Randy Thornton

Re: Ad-hoc database queries: Problems with Link in Query

by Vicke Denniston -
Picture of Testers
I spoke too soon. Is there any way to work a DISTINCT statement in there? I need only 1 result for each of the linked values.
SELECT
u.id AS 'URL id',
/*DISTINCT*/ CONCAT("%%WWWROOT%%/url/view.php%%Q%%id=1010171", cm.module) AS "link module" ,
u.course,
cm.course,
c.shortname,
u.name AS 'url name',/*u.intro AS 'URL intro',
u.externalurl,*/
cm.module
FROM
prefix_url AS u
JOIN prefix_course AS c
ON u.course = c.id
JOIN prefix_course_modules AS cm
ON cm.course = c.id

WHERE u.externalurl LIKE '%ensemble.viterbo%'