title: Best practices to get first date and last date of previous month in oracle
body: <p>To get first date (at time 00:00:00) and last date (at time 23:59:59) of previous month I tried below query and it's giving proper output as expected.</p>
  
  <p>Is below way to obtain first date and last date of previous month is
  correct and best practices? If not than kindly suggest the best
  practices to do the same.</p>
  
  <p><strong>First Date of previous month(Time Part : 00:00:00) :</strong> </p>
  
  <pre><code> select  TRUNC(ADD_MONTHS(SYSDATE, -1),'MM')  from dual ; 
  </code></pre>
  
  <p><strong>Last Date of previous month (Time Part 23:59:59):</strong>  </p>
  
  <pre><code> SELECT last_day(add_months(trunc(sysdate,'mm'),-1)) + INTERVAL '23:59:59'  HOUR TO SECOND FROM DUAL;
  </code></pre>