How to use MySQL grammar with Slingshot package

Hi everyone i want to use Dynamo read MySQL latest data with Slingshot package, i want to use [SELECT TOP 1 FROM table ORDER BY Date_Time DESC] MySQL command ,but I don’t know how to do it, can anyone give some suggestion or example.

Search on this forum for MYSQL, SQLite, SQL or Slingshot
There are several examples or posts on this forum, some by me

Andrew

Thanks @Andrew I have been filter out what i want data.

@Andrew excuse me ,now i want to do the following things as below picture


I know how to get latest time data, but about get not repeat data(ID) i don’t know how to do it .

Can give me some keyword to search this method,thanks.

it depends which data types you are using, particularly for the time column.

If you want to get the latest time, this would often be stored as a datetime column, so that 9am on Wednesday is later than 10am on Tuesday. But if you don’t care about the day, then you could just use a time column.

It is best to use a datetime or time column and not just a string such as 2:19, otherwise you will have problems with sorting or finding the latest (maximum)

Anyway- the key is to use a GROUP BY clause. Note, I have used SQLite- the syntax varies bit between SQL flavours

select id,vl, max(datetime) from tbl_test
group by id

means show all the unique IDs, with the maximum datetime for each ID and corresponding vl column