Tag archive for: inner join

SQL statement for selecting the latest record in each group

When you have multiple IoT devices of the same type, you may collect data in a single database table.

In such a case, you may choose to group data based on the device ID.

So how do you display the latest data capture from each device?

In this situation, we can choose to run an SQL statement that will return the latest record in each group.