Hi, I need to get a table of the last known value, one for each input.
I started with this
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
From the course, now I got all the values ββthat belong to the inputs with the name "DayYield" and "plantId = 1" My question is: how to get a table of only those values ββthat have the latest [TimeStampUtc]
Other words: get all those [Val] that belong to the input of the name "DayYield" and "plantId = 1" and are inserted last into the table.
source share