请教个MYSQL数据库查询语句问题
数据库day有2个字段表示时间
month:year-month 如:2008-05
date:day 如:12
现在我要select *某年某月某日以后,某年某月某日以前的数据,请问这个SQL怎么写啊?
[解决办法]
- SQL code
select *from yourtablewhere concat(`year-month`,'-',`day`) between '2008-01-20' and '2008-02-19'
发布时间: 2012-04-15 18:39:21 作者: rapoo
请教个MYSQL数据库查询语句问题
数据库day有2个字段表示时间
month:year-month 如:2008-05
date:day 如:12
现在我要select *某年某月某日以后,某年某月某日以前的数据,请问这个SQL怎么写啊?
[解决办法]
select *from yourtablewhere concat(`year-month`,'-',`day`) between '2008-01-20' and '2008-02-19'