# How display the last 10 entries of a table?

**URL:** <https://forum.inductiveautomation.com/t/how-display-the-last-10-entries-of-a-table/52586>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [November 1, 2021, 7:23pm UTC](https://forum.inductiveautomation.com/t/how-display-the-last-10-entries-of-a-table/52586 "2021-11-01T19:23:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [November 1, 2021, 7:23pm UTC](https://forum.inductiveautomation.com/t/how-display-the-last-10-entries-of-a-table/52586/1 "2021-11-01T19:23:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matrix\_Engineering](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matrix_engineering/32/19781_2.png) [@Matrix\_Engineering](https://forum.inductiveautomation.com/u/Matrix_Engineering)\
**Post date:** [November 1, 2021, 7:25pm UTC](https://forum.inductiveautomation.com/t/how-display-the-last-10-entries-of-a-table/52586/2 "2021-11-01T19:25:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mjohnson0238](https://avatars.discourse-cdn.com/v4/letter/m/4bbf92/32.png) [@mjohnson0238](https://forum.inductiveautomation.com/u/mjohnson0238)\
**Post date:** [November 1, 2021, 7:34pm UTC](https://forum.inductiveautomation.com/t/how-display-the-last-10-entries-of-a-table/52586/3 "2021-11-01T19:34:11Z")

</div>

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
