开发者

Selecting min date 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 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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜