Code Listing 2: Find the last Saturday of a given month.

SQL> select next_day(
  2              last_day( to_date( '&YOUR_MONTH', 'MM' ))-7,
  3                 to_char( to_date( '29-01-1927', 'dd-mm-yyyy' ), 'DAY' )
  4       )
  5   from dual;

Enter value for your_month: 01
old   2:             last_day( to_date( '&YOUR_MONTH', 'MM' ))-7,
new   2:             last_day( to_date( '01', 'MM' ))-7,
 
NEXT_DAY(
----------
31-JAN-04