# Run Part of a Query

Source: https://userguide.qualytics.io/explore/how-tos/queries/run-part-of-a-query/

Run a selected piece of the SQL, or one statement out of several, while the rest of the editor stays as it is.

> **Info: Related**
>
> - Concept: [Query Editor](https://userguide.qualytics.io/explore/deep-dive/query-editor/) for how the editor splits statements and marks what runs.
> - [Run a Query](https://userguide.qualytics.io/explore/how-tos/queries/run-a-query/) for the whole flow.

> **Note: Permission Required**
>
> Running a query needs the **Author** team permission or higher on every datastore the query reads. Users with the **Admin** role can run queries on any datastore.

**Tab: A selection**

**Step 1:** Select the SQL to run in the editor. The button changes to **Run selection** .

**Step 2:** Click **Run selection** , or press `Cmd`+`Enter``Ctrl`+`Enter`.

Only the selected text runs.

**Tab: The statement under the cursor**

**Step 1:** Make sure each statement in the editor ends with `;`.

**Step 2:** Click anywhere inside the statement to run, with no text selected. A bar beside the line numbers marks the lines that **Run** sends.

**Step 3:** Click **Run** , or press `Cmd`+`Enter``Ctrl`+`Enter`.

Only that statement runs. A green bar beside the line numbers marks the lines that ran.

> **Info: Which statement runs**
>
> - With the cursor on a blank line, or right after a `;`, **Run** sends the statement before it, unless another statement starts later on the same line.
> - When the editor holds a single statement, **Run** sends all of it.
> - When the editor is minimized, **Run** sends the whole SQL.

*Last updated: November 24, 2026.*
