脚本宝典收集整理的这篇文章主要介绍了php – Mysql查询按月和年获取结果,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
id month_month month_year 1 09 2012 2 10 2012 3 11 2012 4 01 2013 5 02 2013 6 03 2013 7 09 2013 8 10 2013
我需要从2012年10月到2013年10月的结果如下
预期结果
id month_month month_year 2 10 2012 3 11 2012 4 01 2013 5 02 2013 6 03 2013 7 09 2013 8 10 2013
但是得到的结果如下
得到结果
id month_month month_year 2 10 2012 8 10 2013
我在下面尝试过查询
选择id,month_month,month_year,其中month_month> = 10 AND month_year> = 2012 AND month_month< = 10 AND month_year< = 2013 需要有用的建议,谢谢!
SELECT id,month_year WHERE (month_month >= 10 AND month_year = 2012) OR (month_month <= 10 AND month_year = 2013)
以上是脚本宝典为你收集整理的php – Mysql查询按月和年获取结果全部内容,希望文章能够帮你解决php – Mysql查询按月和年获取结果所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。