1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| SELECT sc.id, sc.pagetitle, sc.longtitle, sc.description, sc.alias, sc.introtext, sc.menutitle, sc.content, sc.publishedon,
GROUP_CONCAT ( DISTINCT CAST(ntv.id AS CHAR) SEPARATOR "," ) AS tv_id,
GROUP_CONCAT ( DISTINCT ntv.value SEPARATOR ", " )
AS tv_value
FROM `base1`.`mdx_site_content` sc
LEFT JOIN (
SELECT DISTINCT tv.id, tv.value, tv.contentid FROM `base1`.`mdx_site_tmplvar_contentvalues` tv
WHERE ( ((tv.value LIKE '%school%')) ) )
AS ntv ON sc.id = ntv.contentid
WHERE ( sc.id IN (63,64,65,66,67,68,69,70,71,72,73,97) AND sc.published=1 AND sc.searchable=1 AND sc.deleted=0 AND sc.type='document'
AND sc.privateweb=0 )
GROUP BY sc.id
HAVING ( ( (sc.pagetitle LIKE '%school%') OR (sc.longtitle LIKE '%school%') OR (sc.description LIKE '%school%')
OR (sc.alias LIKE '%school%') OR (sc.introtext LIKE '%school%') OR (sc.menutitle LIKE '%school%')
OR (sc.content LIKE '%school%') OR (tv_value LIKE '%school%') ) )
ORDER BY sc.publishedon,sc.pagetitle |
Partager