title: Oracle SQL. Selecting the MAX(Date)
body: <p>Need to update values in a table. Essentially I have added a fromDate and toDate columns. The values I am setting at thepriceDate with: </p>
  
  <p><code>UPDATE schema.myTable 
  SET FROMDATE = PRICEDATE, TODATE = PRICEDATE 
  WHERE FROMDATE IS NULL AND TODATE IS NULL</code></p>
  
  <p>This works. I then need to set the latest date to 6000-01-01. All the rows are unique but can relate to similar objects. So I may have:</p>
  
  <p><code>priceDate   | fromDate   | toDate     |  INSTRUMENT    | uniqueID
   25/09/2018    25/09/2018   25/09/2018       AUD        |    1
   26/09/2018    26/09/2018   26/09/2018       EUR        |    2
   25/09/2018    25/09/2018   25/09/2018       EUR        |    3
   25/09/2018    25/09/2018   25/09/2018       JPN        |    4
   29/09/2018    29/09/2018   29/09/2018       EUR        |    5 
   29/09/2018    29/09/2018   29/09/2018       JPN        |    6
   20/09/2018    20/09/2018   20/09/2018       JPN        |    7
   28/09/2018    28/09/2018   28/09/2018       AUD        |    8</code></p>
  
  <p>I have tried: 
  <code>UPDATE schema.myTable 
  SET TODATE = TO_DATE('60000101', 'yyyymmdd') 
  WHERE TODATE in ( SELECT MAX(TODATE) FROM schema.myTable WHERE HISTTYPE = 'Close' GROUP BY INSTRUMENT );</code></p>
  
  <p>But that gives me multiple of the same Instrument where I only want one of each.
  EDIT:</p>
  
  <p>So after my Query I want:</p>
  
  <p><code>priceDate   | fromDate   | toDate     |  INSTRUMENT    | uniqueID
   25/09/2018    25/09/2018   25/09/2018       AUD        |    1
   26/09/2018    26/09/2018   26/09/2018       EUR        |    2
   25/09/2018    25/09/2018   25/09/2018       EUR        |    3
   25/09/2018    25/09/2018   25/09/2018       JPN        |    4
   29/09/2018    29/09/2018   01/01/6000       EUR        |    5 
   29/09/2018    29/09/2018   01/01/6000       JPN        |    6
   20/09/2018    20/09/2018   20/09/2018       JPN        |    7
   28/09/2018    28/09/2018   01/01/6000       AUD        |    8</code></p>