LAST_DAY function returns the last day of the month in which the input date falls in.
The syntax of this function is: LAST_DAY(datetime-expression).
Example:
The Sysdate in this example is: 10/29/2018 8:24:07 PM
SELECT LAST_DAY (SYSDATE) FROM DUAL;
Result: 10/31/2018 8:24:07 PM
Example 2:
The Sysdate in this example is: 10/29/2018 8:24:46 PM
SELECT LAST_DAY (SYSDATE-300) FROM DUAL;
Result: 1/31/2018 8:24:46 PM