开发者

get that rows, WHERE `DAYOFMONTH(<date>)` is devidable on 3?

I have a table in MYSQL DB with date field in YYYY-mm-dd format. i need to get that rows, DAYOFMONTH(<date>) is devidable on 3.


Is it possible to do with mysql functions, or i have to wr开发者_高级运维ite multiple OR conditions? :/

Thanks


Use modulus.

Something like,

WHERE DAYOFMONTH(<date>) % 3 = 0


WHERE (DAYOFMONTH(<date>) % 3) = 0
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜