我的桌子上有这些字段
month
year
我想根据这个进行查询
month BETWEEN 4 AND 12 AND year = 2008
或者
month BETWEEN 1 AND 10 AND year is greater than 2008 but equal or less than 2009
我试过了,但没有给出正确的查询结果。
"WHERE month BETWEEN 4 AND 12 AND year = 2008 OR month BETWEEN 1 AND 10 AND year 2008<=2009";
注意:这里的数字是可变的,我显示了实际数字以便您轻松理解:) 有帮助吗?
year = (2008<=2009) 表示年份必须大于 2008 但等于或小于 2009