Section: Read and filter rows

Sort and limit results

sql
sql
SELECT id, email, created_at FROM users ORDER BY created_at DESC LIMIT 20;
Explanation

A core pattern for dashboards, logs, and feed-style pages.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Read and filter rows
Select all columns
Read rows from a table.
OpenIn sheetsqlsame section
Select only needed columns
Return a smaller projection.
OpenIn sheetsqlsame section
Filter with WHERE and LIKE
Find rows by pattern.
OpenIn sheetsqlsame section
Paginate with LIMIT and OFFSET
Fetch one page of rows.
OpenIn sheetsqlsame section
Insert one row
Add a new record.
OpenIn sheetsql1 tag match
Insert multiple rows
Add several records in one statement.
OpenIn sheetsql1 tag match