sql语句:同一张表,多条件查询的语句怎么写

请问用sql 语句 如何查出6月之前 有,且6月以后无的ID号 。谢谢!
有个出勤表名为table
ID month report
1 2月 有
1 7月 无
2 4月 无
2 9月 有
3 3月 有
3 10月 有
4 1月 无
4 8月 无
5 5月 有
5 10月 无

select ID from table where report = '无' and month < 6。month字段数值类型

select ID from table where month<6 and report='有' and ID  in (select ID from table where month>=6 and report='无')

更正一下,使用子查询就可以了。
select ID from table where ID in(select ID from table where report='有' AND month < 6) AND
report='无' AND month > 6

select ID from table where ID in(select ID from table where report='有' AND replace(a.month,'月') < 6) AND
report='无' AND replace(a.month,'月') > 6 如果数据量非常大就别用in了 把子查询作为表关联