title: SQL - Selecting rows with a column value greater than the rows before it
body: <p>I'm curious on the best way to write a query.</p>
  
  <p>I have a table of ids and values. I would like to exclude rows where val is less than val in all of the rows with a lower ID. </p>
  
  <p>I was playing with joining this table to itself on id-1 but that didn't work all of the time. </p>
  
  <p>Some sample data </p>
  
  <pre><code>CREATE TEMP TABLE new_temp_table (
      id integer, 
      val integer
  );
  
  INSERT INTO new_temp_table (id, val)
  VALUES (0, 300),
         (1, 150),
         (2, 100), 
         (3, 200),
         (4, 320),
         (5, 120),
         (6, 220),
         (7, 340);
  </code></pre>
  
  <p>I want the following output.</p>
  
  <pre><code>--- id --- val 
  --- 0  --- 300
  --- 4  --- 320
  --- 7  --- 340 
  </code></pre>
  
  <p>Any help/direction would be appreciated. </p>