SELECT DISTINCT nuke_paged_content.page_id AS page_id .... fungerar nog lika bra som GROUP BY, men jag hade kört GROUP BY ändå.
Mao:
Kod:
SELECT DISTINCT nuke_paged_content.page_id AS page_id, nuke_paged_content.subtitle AS subtitle, nuke_paged_content.text AS text, nuke_paged_titles.title AS title, nuke_paged_titles.ingress AS ingress, nuke_paged_titles.topic_id AS topic_id
FROM nuke_paged_content
LEFT JOIN nuke_paged_titles ON ( nuke_paged_content.page_id = nuke_paged_titles.page_id )
WHERE (
nuke_paged_content.subtitle
LIKE "%sökord%" OR nuke_paged_titles.title
LIKE "%sökord%" OR nuke_paged_titles.ingress
LIKE "%sökord%" OR nuke_paged_content.text
LIKE "%sökord%"
)
ger samma som:
Kod:
SELECT nuke_paged_content.page_id AS page_id, nuke_paged_content.subtitle AS subtitle, nuke_paged_content.text AS text, nuke_paged_titles.title AS title, nuke_paged_titles.ingress AS ingress, nuke_paged_titles.topic_id AS topic_id
FROM nuke_paged_content
LEFT JOIN nuke_paged_titles ON ( nuke_paged_content.page_id = nuke_paged_titles.page_id )
WHERE (
nuke_paged_content.subtitle
LIKE "%sökord%" OR nuke_paged_titles.title
LIKE "%sökord%" OR nuke_paged_titles.ingress
LIKE "%sökord%" OR nuke_paged_content.text
LIKE "%sökord%"
GROUP BY page_id
)
säger jag utan att ha provat =)