[Cologne-pm] Teilmengenrelation in SQL (was: cologne.pm: Der Letzte Atemzug)

Joachim Zobel jzobel at heute-morgen.de
Sat Feb 26 09:23:48 PST 2005


Hi.

Für MySQL sieht das so aus:

SELECT m.sid, s.sid
FROM sets m, sets s
GROUP BY m.sid, s.sid
HAVING SUM(IF(m.eid=g.eid, 1, 0))=COUNT(DISTINCT s.eid)

Das Problem ist, das der GROUP BY auf dem Cross Join weder performant
ist noch skaliert . 

Gruß,
Joachim




More information about the Cologne-pm mailing list