If you want to retrieve the last record based on a different column, you can modify the ORDER BY clause accordingly. If you want to retrieve the last record based on the created_at column, you can use this query:
SELECT TOP 1 * FROM my_table ORDER BY created_at DESC;



