Ilja: MySQL Order By etwas komplizierter

Beitrag lesen

yo,

SELECT o.OID, o.objektname, COUNT (*) AS Freedays
FROM Objekte AS o, Kalender AS k
WHERE o.oid = k.oid
AND k.day BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 14 DAY))
GROUP BY o.OID, o.objektname
ORDER BY o.spezial DESC, Freedays DESC

Ilja