# Table data

Open any table from the sidebar to page through its rows, sort by a column, filter with a bar that shows the SQL it builds, hide columns and copy what you need.

## Where to find it

| Action | How |
| --- | --- |
| Open a table | Click it in the sidebar, or `⌘P` (`Ctrl+P`) |
| Show the rows | `Data` below the grid, `⌘⌃[` (`Ctrl+Alt+[`) |
| Show or hide filters | `Filters` below the grid, `⌘F` (`Ctrl+F`) |
| Add a filter | `Add` in the filter bar, `⌘⇧I` (`Ctrl+Shift+I`) |
| Choose columns | `Columns` below the grid, `⌘⌥F` (`Ctrl+Alt+F`) |
| Read a long value | Right-click a cell, then `Quick Look` |
| Open the console | `⌘⇧C` (`Ctrl+Shift+C`) |
Grid shortcuts act on the grid that has focus, so click a cell first.

## Sorting

Click a column heading to sort by that column. The first click sorts descending, the second ascending, and the third removes the sort. An arrow in the heading shows the direction, and the database sorts the whole table, not only the rows on screen. The bar below the grid shows the row count.

![The orders table sorted by placed_at with a down arrow in its heading, the newest orders first, and 120 rows in the bar below the grid.](https://bobbytables.app/docs/img/table-data/01-orders-sorted.png)

_The heading arrow shows the sort._

[The total heading is clicked three times: the column sorts descending, then ascending, then returns to the original order.](https://bobbytables.app/docs/video/table-data/02-sort-cycle.mp4)

_Each click moves to the next step: descending, ascending, unsorted._

## Paging

A table opens 500 rows at a time, shown as `Limit` and `Offset` in the bar below the grid. Type new values and choose `Go`, or use the buttons for the first, previous, next and last page. The bar shows which rows are on screen, such as `rows 501 to 1,000`.

![A 2,000-row table on its second page, with Limit 500, Offset 500 and rows 501 to 1,000 in the bar below the grid.](https://bobbytables.app/docs/img/table-data/03-pager.png)

_Limit and Offset set the page size and position._

## Filters

`Filters` opens a bar above the grid where each row picks a column, an operator and a value, and rows must match every filter. Text columns offer `contains`, `starts with` and `ends with`, while number and date columns offer comparisons and `between`. `SQL` shows the statement the filters build, and `Apply` runs it. Right-clicking a cell offers `Filter by value`.

![The books table with two filters, format = paperback and price < 20, the generated SELECT on the SQL line, and the seven matching rows below.](https://bobbytables.app/docs/img/table-data/04-filter-bar.png)

_The SQL line shows what the filters build._

![The operator list open on the format filter, showing =, !=, contains, starts with, ends with, in, is null and is not null.](https://bobbytables.app/docs/img/table-data/05-operator-menu.png)

_The operators follow the column's type._

## Columns and Quick Look

`Columns` opens `Visible columns`, where you untick columns and choose `Apply`, and `Show all` brings them back. For a long value, right-click the cell and choose `Quick Look`. It formats JSON, offers `Raw`, `Wrap` and `Copy`, and closes with `Esc`.

![The Visible columns popover with placed_unix and shipping_address unticked, and the orders grid behind it without those columns.](https://bobbytables.app/docs/img/table-data/06-column-visibility.png)

_Unticked columns leave the grid when you choose Apply._

![Quick Look open under a books metadata cell, showing the JSONB value formatted over several lines with Pretty, Raw, Wrap and Copy controls.](https://bobbytables.app/docs/img/table-data/07-quick-look-json.png)

_Quick Look shows the whole value, formatted._

## Views and copying

Views open, page, sort and filter the same way as tables. A view has no primary key, so the grid shows `This table has no primary key, so rows cannot be identified for editing.` and disables the editing buttons. To copy, select cells, right-click and choose `Copy`, `Copy cell value`, `Copy column values` or a format under `Copy as`, which [Results grid](https://bobbytables.app/docs/results) describes.

![The book_sales view under an amber banner saying there is no primary key, with Row, Duplicate and Delete disabled.](https://bobbytables.app/docs/img/table-data/08-view-read-only.png)

_A view reads like a table, but the grid does not edit it._

## Good to know

- Sorting, filtering and paging run on the database server, and the console lists each query the app sends. The console shows values as parameters, while the `SQL` line shows them inline.
- NULL appears as an italic `NULL`, never as an empty cell.
- `Default filter state` in `Preferences` > `Data` decides whether a table reopens with its last filters.

![The console below the filtered books grid, listing the SELECT and COUNT queries the app sent for the filters, with their times and row counts.](https://bobbytables.app/docs/img/table-data/09-console-select.png)

_Every page load appears in the console._

## Related

- [Editing rows](https://bobbytables.app/docs/editing.md)
- [Row inspector](https://bobbytables.app/docs/row-inspector.md)
- [Structure](https://bobbytables.app/docs/structure.md)
- [Results grid](https://bobbytables.app/docs/results.md)
