How display the last 10 entries of a table?

Good day, I am using this expression to filter a table. I want to only display the last 10 entries. How do i filter that out?

SELECT
“HS10_End_Time”
,“HS10_Start_Time”
,FORMAT((“HS10_End_Time” - “HS10_Start_Time”), ‘HH:mm:ss’) as Duration
FROM
Misc_Rail_LGV_Call_Time
WHERE
“HS10_End_Time” IS NOT NULL

Thank you

In MS SQL it would be select top 10…

In MySQL/maria it’s Select… Limit 10

Use Order by asc/desc to get the right order

I got ya. This works, THANKS!

SELECT TOP 10
“HS10_End_Time”
,“HS10_Start_Time”
,FORMAT((“HS10_End_Time” - “HS10_Start_Time”), ‘HH:mm:ss’) as Duration
FROM
Misc_Rail_LGV_Call_Time
WHERE
“HS10_End_Time” IS NOT NULL
ORDER BY
“misc_rail_lgv_call_time_ndx” DESC

1 Like