# Get the Most Recent 'N' Rows

A common usage for tables is to display the most recent 'n' rows/results from a table.

1. Ensure that an index for the table has been correctly configured.

   Note: See the Create an Index for a SQLite Database topic for more information.

2. Create a query with the following in the Query Text field:

   SELECT * FROM #TABLE

   ORDER BY InspectionTime DESC

   LIMIT @Limit

   - In Designer, #TABLE will automatically be replaced with the table name that the query belongs to.
   - The InspectionTime column is a DateTime data type, used to record the date and time when the product was inspected.
   - The LIMIT refers to a Query Parameters, as an Integer data type, that selects the first 1000 rows returned from the query.