title: Oracle SQL get the first and last records from an ordered dataset
body: <p>The software I am working on has a requirement to get the first and last records of an ordered dataset. Dataset is ordered by a date column.</p>
  
  <p>The data I have:</p>
  
  <pre><code>--table "notes":
  --    ordered by this
  --                |
  --                V
  note_id      date_created attribute1  attribute2  ... -- I want to get
  -----------------------------------------------------
  596          2014/01/20   ...         ...         ... -- &lt;- this
  468          2014/02/28   ...         ...         ...
  324          2014/03/01   ...         ...         ...
  532          2014/04/08   ...         ...         ...
  465          2014/05/31   ...         ...         ... -- &lt;- and this
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>596          2014/01/20   ...         ...         ...
  465          2014/05/31   ...         ...         ...
  </code></pre>