Ver originalSELECT DISTINCT (SELECT SUM(total) FROM alquilerWHERE fentrada BETWEEN '2001-01-01' AND '2011-08-04' AND estado='PAGADO' OR estado='OCUPADO') + IFNULL((SELECT SUM(entrega) FROM alquilerWHERE fentrada BETWEEN '2011-01-08' AND '2011-05-08' AND estado='OCUPADO'),0) + IFNULL((SELECT SUM(entrega) FROM alquilerWHERE fentrada BETWEEN '2011-01-08' AND '2011-05-08' AND estado='DEBE'),0) AS xTotal;