SELECT months_between(to_date('201005','yyyymm'),to_date('200905','yyyymm'))+1 AS mon FROM dual