title: How to use if-else statement in Standard Bigquery?
body: <p>If I have a table like the following:</p>
  
  <pre><code>|**Entry**-------**Name**--------**Date**------------------**Boolean**|    
  |  1.-----------Car-----------2019-12-01----------True|  
  |  2.-----------Car-----------2019-12-03----------False|  
  |  3.-----------Bus-----------2019-12-05----------False|  
  |  4.-----------Bus-----------2019-12-11----------False|
  </code></pre>
  
  <p>I want to select a row with distinct <strong>Name</strong> if <strong>Boolean</strong> column is true, or if the boolean values are false then select the row with earliest date. So for the <strong>car</strong> entry I want to select the first row since the boolean for it is true (so I can ignore all other entries) and for the <strong>bus</strong> entry I want to select the last row since both the booleans for it are false so I want to pick the earliest date (closest to present date).  </p>
  
  <p>Edit: Expected output</p>
  
  <p>|  1.-----------Car-----------2019-12-01----------True|<br>
  |  4.-----------Bus-----------2019-12-11----------False|</p>