oracle date - last month and this month

Judge this month

substr(date,1,7)=to_char(last_day(to_date('2019-04-25','yyyy-mm-dd')), 'yyyy-mm')

 

Previous month (including this month)

substr(date,1,INSTR(date,' ')-1) <= to_char(last_day(to_date('2019-04-25','yyyy-mm-dd')), 'yyyy-mm-dd')
 

Published 80 original articles · won praise 0 · Views 647

Guess you like

Origin blog.csdn.net/weixin_42699486/article/details/89710832
Recommended