Minimum date selection, excluding 0000-00-00

I am running a query in SQL and I need to select a minimum date that is not 0000-00-00. Is there a way to exclude this value and select the next minimum date?

+2


a source to share


2 answers


SELECT  MIN(mydate)
FROM    mytable
WHERE   mydate > '0000-00-00'

      



+6


a source


select min(date) 
from tbl 
where date > '0000-00-00'

      



0


a source







All Articles