que tal orpheus
Prueba con:
Código sql:
Ver originalSELECT c.matricula, c.capacidad,turnoM.libres AS libresM, turnoT.libres AS libresT
FROM servicios s, coches c, (SELECT c.matricula AS matri, capacidad-COUNT(*) AS libres
FROM servicios s, coches c
WHERE s.matricula=c.matricula AND turno = 'M'
GROUP BY c.matricula, c.capacidad,s.turno
ORDER BY c.matricula, c.capacidad,s.turno ) AS turnoM, (SELECT c.matricula AS matri, capacidad-COUNT(*) AS libres
FROM servicios s, coches c
WHERE s.matricula=c.matricula AND turno = 'T'
GROUP BY c.matricula, c.capacidad,s.turno
ORDER BY c.matricula, c.capacidad,s.turno ) AS turnoT
WHERE s.matricula=c.matricula AND turnoT.matri = c.matricula
AND turnoM.matri = c.matricula
GROUP BY c.matricula, c.capacidad,turnoM.libres,turnoT.libres
ORDER BY c.matricula, c.capacidad
Espero te sirva.