title: SQL select columns group by
body: <p>If I have a table which is of the following format:</p>
  
  <pre><code>ID NAME NUM TIMESTAMP BOOL
  1  A    5   09:50     TRUE 
  1  B    6   13:01     TRUE
  1  A    1   10:18     FALSE   
  2  A    3   12:20     FALSE
  1  A    1   05:30     TRUE
  1  A    12  06:00     TRUE
  </code></pre>
  
  <p>How can I get the ID, NAME and NUM for each unique ID, NAME pair with the latest Timestamp and BOOL=TRUE.</p>
  
  <p>So for the above table the output should be:</p>
  
  <pre><code>ID NAME NUM
  1  A    5
  1  B    6   
  </code></pre>
  
  <p>I tried using Group By but I cannot seem to get around that either I need to put an aggregator function around num (max, min will not work when applied to this example) or specifying it in group by (which will end up matching on ID, NAME, and NUM combined). Both as far as I can think will break in some case.</p>
  
  <p>PS: I am using SQL Developer (that is the SQL developed by Oracle I think, sorry I am a newbie at this)</p>