Registriert seit: 26. Aug 2004
Ort: Nebel auf Amrum
3.154 Beiträge
Delphi 7 Enterprise
|
Re: Problem mit aufeinanderfolgenden OUTER JOINs in MySQL
11. Jun 2006, 02:06
Was spricht gegen normale LEFT JOINs?
SQL-Code:
SELECT sm.serie_id AS id,
serie_title AS title,
serie_image AS image,
COUNT(cp.serie_id) AS charguide,
serie_author AS author,
serie_author_gender AS author_gender,
COUNT(sp.serie_id) AS story,
COUNT(ep.serie_id) AS epiguide,
COUNT(op.serie_id) AS opening,
COUNT(ssp.serie_id) AS syncspeaker,
COUNT(mp.serie_id) AS manga
FROM page_series_main sm
LEFT JOIN page_charguide_items cp
ON sm.serie_id = cp.serie_id
LEFT JOIN page_story_pages sp
ON sm.serie_id = sp.serie_id
LEFT JOIN page_epiguide_pages ep
ON sm.serie_id = ep.serie_id
LEFT JOIN page_opening_pages op
ON sm.serie_id = op.serie_id
LEFT JOIN page_syncspeaker_pages ssp
ON sm.serie_id = ssp.serie_id
LEFT JOIN page_manga_pages mp
ON sm.serie_id = mp.serie_id
WHERE sm.serie_id = 1
AND serie_visible != 0
GROUP BY sm.serie_id
LIMIT 1;
Gruss
Thorsten
|
|
Zitat
|