数据库的查询条件解决方案

数据库的查询条件我现在有一个表 table传入两个参数 例如2012-12012-3idyearMonth12012122012232012342012

数据库的查询条件
我现在有一个表 table 传入两个参数 例如2012-1 2012-3

 id year Month
  1 2012 1
  2 2012 2  
  3 2012 3
  4 2012 4

我根据 那2个参数 在2012-1 和2012-3 之间的数据

求指教

[解决办法]
先拼起来,再比较

SQL code
select id,year+month as ym from table where ym>'2012-1' and ym<'2012-3'
[解决办法]
SQL code
select id,year+'-'+month as ym from table where ym>'2012-1' and ym<'2012-3'
[解决办法]
SQL code
select id,year+month as ym from table where year+month>'2012-1' and year+month<'2012-3'