I'm stuck with a SQL Query.
I have this table:
[Reserve]
- ID NUMBER
- START_DATE, DATE
- END_DATE, DATE
.......... (more cols)
I need to look if the next count is more than 0 for any of the dates between START_DATE and END_DATE (including both). If the count is more than 0, the query must stop inmediately and return "There is no location" as a string.
SELECT Count(*)
FROM disponibilidad
JOIN estadia ON disponibilidad.identificador_estadia = estadia.identificador
WHERE estadia.identificador = 1
AND disponibilidad.numero_reservas > 500