> ## Documentation Index
> Fetch the complete documentation index at: https://ngquct-feat-ai-sql-walkthroughs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Filtering

> Filter table data with 18 operators, raw SQL, and saved presets

# Filtering

Press `Cmd+F` while viewing a table to open the filter panel. Type a raw SQL WHERE clause and press `Enter` to filter. Raw SQL is the default mode.

<Frame caption="Filter panel with column and raw SQL conditions">
  <img className="block dark:hidden" src="https://mintcdn.com/ngquct-feat-ai-sql-walkthroughs/REI9tfF_TGivM099/images/filter-panel.png?fit=max&auto=format&n=REI9tfF_TGivM099&q=85&s=59bb047d13668485c6f740d7fcf8d242" alt="Filter panel above the data grid" width="1560" height="960" data-path="images/filter-panel.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/ngquct-feat-ai-sql-walkthroughs/REI9tfF_TGivM099/images/filter-panel-dark.png?fit=max&auto=format&n=REI9tfF_TGivM099&q=85&s=543164943d1c4f06d286f69c141a2bdf" alt="Filter panel above the data grid" width="1560" height="960" data-path="images/filter-panel-dark.png" />
</Frame>

Each row has a checkbox, a column picker, operator, value field, and **+**/**−** buttons. The **Match all** / **Match any** picker in the header combines rows with AND or OR. You can also right-click a column header in the data grid and choose **Filter with column** to pre-fill a filter row for that column.

| Control                                                         | What it does                                                                                                                                        |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| Header **Apply** (or `Enter` in a value field, or `Cmd+Return`) | Runs all checked filter rows                                                                                                                        |
| Row checkbox                                                    | Turns that filter off without deleting it; unchecked rows stay dimmed. Toggling does not re-run the query, press **Apply** when ready               |
| Row **Apply**                                                   | Filters by just that row, leaving all checkboxes as they are, so you can test one condition and return to the checked set with the header **Apply** |
| **Clear**                                                       | Removes the applied filter without deleting the filter rows                                                                                         |

When you reopen a table, TablePro restores the filters you last applied to it, including the ones you left unchecked, after you quit and relaunch. Filters are saved per connection, database, schema, and table, so two tables on the same connection keep independent filters. If you cleared the filter with **Clear** or removed its rows with **−**, the table reopens unfiltered. Tables with active filters open in a new tab when you click another table.

The filter panel queries the database. To narrow rows already loaded in the grid without re-querying, use the column value filter in the [Data Grid](/features/data-grid).

<Note>
  Redis shows a key-pattern search bar (for example `user:*`) with a key-type picker instead of the filter panel.
</Note>

## Operators

18 operators with SQL symbols shown inline: `=`, `!=`, `LIKE %..%`, `NOT LIKE %..%`, `LIKE ..%`, `LIKE %..`, `>`, `>=`, `<`, `<=`, IS NULL, IS NOT NULL, IS EMPTY, IS NOT EMPTY, `IN (..)`, `NOT IN (..)`, `BETWEEN`, `~` (regex).

BETWEEN shows two value fields. IN/NOT IN takes comma-separated values.

## Raw SQL

The default mode. Type any WHERE condition directly:

```sql theme={null}
created_at > NOW() - INTERVAL 7 DAY
```

```sql theme={null}
price * quantity > 1000
```

As you type, autocomplete suggests the table's columns and SQL keywords at every position in the expression, including after AND and OR. Use the arrow keys to pick a suggestion and Tab or Return to insert it. Suggestions only appear once you start a word, not on an empty field or after a space. Press Escape to dismiss the suggestions; the filter bar stays open.

To switch a row to column mode, select a column from the picker.

<Warning>
  Raw SQL is injected directly into the WHERE clause. Ensure syntax matches your database type.
</Warning>

## Presets

Save and load filter configurations via the **⋯** menu in the header.

| Action | How                                |
| ------ | ---------------------------------- |
| Save   | ⋯ > **Save as Preset...**          |
| Load   | ⋯ > click preset name              |
| Delete | ⋯ > **Delete Preset** > click name |

## SQL Preview

⋯ > **Preview Query** shows the generated WHERE clause with a copy button.

## Settings

⋯ > **Filter Settings** to configure:

| Setting          | Options                                       |
| ---------------- | --------------------------------------------- |
| Default Column   | Raw SQL, Primary Key, Any Column              |
| Default Operator | Equal, Contains                               |
| Panel State      | Always Hide, Always Show, Restore Last Filter |

**Panel State** controls what happens when you reopen a table. **Restore Last Filter** (the default) brings back the filter you last applied. **Always Hide** reopens tables unfiltered with the panel closed. **Always Show** keeps the filter panel visible even when no filter is set.
