Skip to content

Editing live queries

The result of a SELECT query is editable whenever it draws its data from a single table. This lets you filter or sort a table with a query and then edit the results in place — a quick way to work with just the rows you care about.

Editing a query result works exactly like editing table data; the only difference is that the grid appears on the SQL tab, below your query.

A query result on the SQL tab A query result on the SQL tab

Note

A result set becomes read-only as soon as it combines more than one table (for example through a join) or uses aggregation, because SQLite Expert can no longer tell which underlying row each cell belongs to. To edit that data, query a single table instead.

What the grid says about itself

At the right end of the strip beside every data grid — on the Data, SQL and Scripting tabs alike — two words say what you can expect of it:

It says Meaning
editable the rows can be changed, and the changes are written back to the table
read-only they cannot; hover for which of the reasons above applies
fast scrolling the result has an ordering key, so dragging the scrollbar seeks straight to a row
sequential scrolling it has no key the grid can seek on, so reaching a distant row means reading the rows before it

Neither is anything you choose — both follow from the query. The same table can report either kind of scrolling: SELECT * FROM customer has the table's own key to seek on, while SELECT * FROM customer ORDER BY Company is sorted by a column that is not the key, so the grid has to read its way to a distant row. On a small table you will not notice; on a large one it is the difference between an instant and a wait.

The scrolling half appears once the first rows have been read, because until then there is nothing to report.

Tip

Hovering over those words explains them — which key the grid is seeking on, or exactly why the result cannot be written back to. (That explanation is one of the ones Tools → Options → General → Tooltips → Explain commands in tooltips governs; it is on unless you have turned it off.)

See also: Editing table data · Executing SQL scripts