title: Query Data From Two Tables + One Table Must Only Query Using Most Recent Data
body: <p>ok, I have one table that I'm querying that has historical data in it that is updated every minute or so.  I am pulling the most recent data from it by VehicleKey using the following:</p>
  
  <pre><code>SELECT p.VehicleKey, p.Timestamp, p.Latitude, p.Longitude, p.Speed
  FROM AVLVehiclePosition p,
      (SELECT max(Timestamp) as maxtime, VehicleKEy
        FROM AVLVehiclePosition
        GROUP BY VehicleKey) maxresults  
  WHERE p.VehicleKey = maxresults.VehicleKEy  
  AND p.Timestamp = maxresults.maxtime
  </code></pre>
  
  <p>I need to also pull some related information from a second table and return it with the results of the above query.  I have figured out how to pull the related data by VehicleKey for EVERY instance of the VehicleKey:</p>
  
  <pre><code>SELECT p.Timestamp, p.Latitude, p.Longitude, p.Speed, v.Name, v.VehicleKey
  FROM AVLVehiclePosition p, Vehicle v
  WHERE p.VehicleKey = v.VehicleKey
  </code></pre>
  
  <p>Now I don't know what to do to combine the two queries to where I'm pulling v.Name for ONLY the most recent results...</p>