MySQL Forums
Forum List  »  Oracle

Re: Help with heavy query
Posted by: Hector Tino
Date: October 23, 2014 06:40PM

i try this:

SELECT
count(H.tipoHabitacion) AS total
FROM
AviratoPMS.habitaciones H
INNER JOIN
AviratoPMS.bloqueoHabitaciones B ON (H.idHabitacion != B.idHabitacion
AND H.idhospital = 1
AND H.online = '1'
AND H.tipoHabitacion = 'CUADRUPLE'
AND B.idhospital = 1
AND NOT (DATE(B.fechaInicial) >= DATE('4-10-2014')
OR DATE(B.fechaFinal) <= DATE('3-10-2013')))
INNER JOIN
AviratoPMS.reservas R ON (H.idHabitacion != R.idHabitacion
AND R.idhospital = 1
AND R.estado not in ('Eliminada' , 'No Show', 'Reserva cancelada')
AND NOT (DATE(R.fechaEntrada) >= DATE('4-10-2014')
OR DATE(R.fechaSalida) <= DATE('3-10-2013')))
;



But donĀ“t work for me :S Help Please

Options: ReplyQuote


Subject
Views
Written By
Posted
1589
October 23, 2014 02:39PM
Re: Help with heavy query
934
October 23, 2014 06:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.