title: More Efficient Way to Grab the Latest Value based off a composite index?
body: <p>I have a table called SAMPLE_TABLE that has the following columns, with CAR_TYPE, COLOR and CAR_BRAND making up the composite index. </p>
  
  <pre><code> VALUE_ID      VALUE      CAR_TYPE     COLOR     SUBMIT_DT      CAR_BRAND
     1            10        Sedan        Blue      3/7/2019       Ford
     2            70        Sedan        Blue      3/6/2019       Ford
     3            20        Sedan        Blue      3/5/2019       Ford
     4            77         SUV         Red       3/7/2019       Volvo
     5           100         SUV         Red       3/1/2019       Volvo
  </code></pre>
  
  <p>Is there a way I can write a more efficient way to query for the Value correlated to the LATEST <code>SUBMIT_DT</code>? In the future, the TABLE will have millions of rows of data, so I will need to find a query with the lowest run-time/cost that can query. </p>
  
  <p>For example, below is what I would want in my result set when querying for a Blue Ford Sedan:</p>
  
  <pre><code> VALUE
   10
  </code></pre>
  
  <p>Below is what I have thus far:</p>
  
  <pre><code> SELECT value 
     FROM (
            SELECT *
              FROM TABLE
             WHERE CAR_TYPE = rCar_Type
               AND COLOR = rColor
               AND CAR_BRAND = rCar_Brand
              ORDER by submit_dt desc
          )
     WHERE rownum = 1;
  </code></pre>
  
  <p>Is this inefficient?</p>
  
  <p>Thanks in advance</p>