title: SQL inner join with top 1
body: <p>Hi I need to get table of latest known value one for each input.</p>
  
  <p>I started with this </p>
  
  <pre><code>SELECT [MeterReadingId]
        ,[TimeStampUtc]
        ,[Val]
        ,[MeterReading].[InverterInputId]
        ,[Status]
    FROM [Project].[dbo].[MeterReading]
    inner join InverterInput on [MeterReading].InverterInputId = [InverterInput].InverterInputId
    inner join Inverter on [InverterInput].InverterId = [Inverter].InverterId 
    where [InverterInput].InputName = 'DayYield' and [Inverter].PlantId = 1
  </code></pre>
  
  <p>off course now i got all values which belong to inputs of name 'DayYield and plantId =1
  My question is how can got table only of those values which have latest [TimeStampUtc] </p>
  
  <p>Other words: get all those [Val] which belong to input of name  'DayYield and plantId =1 and are last inserted into table.</p>