Query to get last month data form table in Oracle
select * from sale_master
where transdate>= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and transdate <= LAST_DAY(ADD_MONTHS(SYSDATE, -1))
order by transdate
;
where transdate>= TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')
and transdate <= LAST_DAY(ADD_MONTHS(SYSDATE, -1))
order by transdate
;
No comments: