# Filter

The advanced filter helps you quickly filter out data from a table. It saves you time writing long & complex queries.

TablePlus generates the SELECT queries with the WHERE conditions defined by the filters to execute and return the results.

## **Row filters**

Open the data filter by clicking on the **`Filters`** button at the bottom, or use shortcut key **`⌘ + F`**.

* **To apply a single filter**, click on the **`Apply`** button on the right of that filter, or you can select that filter and press **`Return`** key.
* **To duplicate a filter**, click on the **`+`** button on the right of that filter, or you can select it and use shortcut key **`⌘ + I`**.
* **To remove a filter**, click on the **`-`** button on the right of that filter, or you can select it and use shortcut keys **`⌘ + ⇧ + I`**.
* **To apply multiple filters**, tick the checkbox on the left to select, and click Apply all or use shortcut key **`⌘ + Return`** to apply the selected filters.
* **To reload the table content without filtering**, click the **`Unset`** button
* **To show the generated SQL query**, select the filters and click on the SQL button.
* **To exit the filters**, press **`ESC`** key, or click on the **`Filters`** button at the bottom of the table.

![](https://2743975646-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LriZ7WXXZykpg6_MQsw%2F-LrtE1v94o6zMQ-Irdd0%2F-LrtE96aL2JLlnOxC7WJ%2Ffilters.gif?alt=media\&token=57124fac-bf8c-46d4-a470-3bdc0dfc3349)

{% hint style="info" %}
You can see the Apply button of each filter to know the status of the current data table. If the button is **`Apply`**, it's not filtered. If the button is **`Applied`**, the table is being filtered by it.
{% endhint %}

To open a quick filter by a column, right click on the column title and choose **`Filter with column`**

A quick filter by value can also be opened by right clicking on a data cell and choose **`Quick filter`**, or clicking on foreign key referencing arrow in a data cell.

### Customize default filter

There are some setting options for the row filters that you can find by clicking on the config/setting button right below the filters:

* Change default filter column to:
  * Raw SQL
  * Primary key (if exist)
  * Any column
* Change default filter operator to:
  * **`=`**
  * **`Contains`**
* Change the default filter state to:
  * Restore the last filter state
  * Always show
  * Always hide

## **Column filter**

The column filter is used to show only some selected columns from the current table.

To use the column filter:

* Click on the Column button at the bottom or use the shortcut key ⌘ + Option + F.
* Select the columns you want to see, and hit Apply.

To go back to the full table view, open the column filter, click on Clear button, then Apply.

![](https://2743975646-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LriZ7WXXZykpg6_MQsw%2F-LrtE1v94o6zMQ-Irdd0%2F-LrtF_wPj1Pd09BiSy3u%2Fcolumn%20filter.gif?alt=media\&token=683c87a8-8f41-4e90-9d08-c039fd2b6c2d)
