开发者

Selecting min date excluding 0000-00-00

开发者 https://www.devze.com 2022-12-28 23:02 出处:网络
I am running a query in SQL, and I need to select a minimum date that is not 0000-00-00.Is 开发者_如何学运维there any way to exclude this value and choose the next minimum date?SELECTMIN(mydate)

I am running a query in SQL, and I need to select a minimum date that is not 0000-00-00. Is 开发者_如何学运维there any way to exclude this value and choose the next minimum date?


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


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

精彩评论

暂无评论...
验证码 换一张
取 消