code in sql does not meet the AND condition

0

where it is commented, prints me for example a date where in loan the day has a 06, but on the return date it does not have it and this record is being excluded, being that I put an AND so that when the return is different from 06 and the loan is different from 06 there exclude: S

--no funciona LA CONDICION COMENTADA
SELECT e.ID_LECTOR,e.NOMBRE, p.FECHA_PRESTAMO, p.FECHA_DEVOLUCION
FROM ESTUDIANTE e
JOIN PRESTAMO p
ON e.ID_LECTOR = p.ID_LECTOR
GROUP BY e.ID_LECTOR,e.NOMBRE, p.FECHA_PRESTAMO, p.FECHA_DEVOLUCION
--HAVING ((EXTRACT(DAY FROM  p.FECHA_PRESTAMO) <> 06)
--AND (EXTRACT(DAY FROM  p.FECHA_DEVOLUCION) <> 06))
ORDER BY ID_LECTOR;

in a few words, I would like to say that if the day on date_is to be 6 and the date on the return date is 6, do not show that record, but it is not doing it in the commented condition.

    
asked by RicardoBarros 03.09.2017 в 21:16
source

0 answers