# Modify an output in SQL

When creating or editing an output, toggle from **UI** to **SQL** in order to directly modify the output through SQL.

To change the SQL page view, click the required button to view more or fewer panes.<img src="https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MG0a-EkYIQzL9CtXIxU%2F-MG4GDgcv4qfsxSWh69G%2FScreen%20Shot%202020-08-31%20at%209.05.48%20AM.png?alt=media&#x26;token=8ef5fb9f-40eb-4166-9494-1f2d5daabb10" alt="" data-size="line">&#x20;

## Edit the output in SQL

Toggling to the SQL view will show you your current output as a SQL query. You can edit this directly to change the output as desired.

{% hint style="info" %}
**See:** [Transform with SQL](https://upsolver.gitbook.io/upsolver-1/data-outputs-and-data-transformation/data-transformation-ui/transform-with-sql) for more information on syntax.
{% endhint %}

When you click inside the SQL code, your current cursor position is updated.

![](https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MG0a-EkYIQzL9CtXIxU%2F-MG4GnGye9n1tWpYY05Y%2FScreen%20Shot%202020-08-31%20at%209.06.44%20AM.png?alt=media\&token=fe401119-7039-4f75-9567-6da43e23eb23)

You can also increase or decrease the font size to make it easier to edit and hover over the question mark icon<img src="https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MG4IuY8YEzfxUCj7C5W%2F-MG4IxW7hn4Zzt0tV6fO%2FScreen%20Shot%202020-08-31%20at%209.17.14%20AM.png?alt=media&#x26;token=5bebed22-2615-4525-ade8-fe6b52e0ea4b" alt="" data-size="line">to view the available keyboard shortcuts.

![](https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MG0a-EkYIQzL9CtXIxU%2F-MG4HQrSgUn-WeDF2Z50%2FScreen%20Shot%202020-08-31%20at%209.11.00%20AM.png?alt=media\&token=946d6b96-6736-473b-ba74-464fcd85cec7)

## Preview

The **Preview** pane allows you to create various “snapshots” of the output SQL and enables you to try different SQL queries until you find the one that you want.

![SQL view with Preview pane open](https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MGFeYQHzo8BWSJk7eIY%2F-MGFfh8UDX25gepSRu5N%2FScreen%20Shot%202020-09-02%20at%202.17.01%20PM.png?alt=media\&token=13a340b9-f97c-4b0d-b991-d3a509927bf8)

* Click and drag the grip icon<img src="https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MGFeYQHzo8BWSJk7eIY%2F-MGFg3J10zEYvReXtLOh%2FScreen%20Shot%202020-09-02%20at%202.18.48%20PM.png?alt=media&#x26;token=7fddc6a5-7c5e-4b21-82d1-8d22be89e4ed" alt="" data-size="line">to view more or less of the **Preview** pane.
* Click the chart icon<img src="https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MGFeYQHzo8BWSJk7eIY%2F-MGFgQX6QR2KljNicHxY%2FScreen%20Shot%202020-09-02%20at%202.20.12%20PM.png?alt=media&#x26;token=c7e808ef-8217-45be-9832-3fd2155ecf67" alt="" data-size="line">to view the events graph.
* Click the filter icon<img src="https://1488427404-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAbbZ6XL3iXMHb3pjqP%2F-MGFeYQHzo8BWSJk7eIY%2F-MGFgTX54r2PEW0Il7nN%2FScreen%20Shot%202020-09-02%20at%202.20.29%20PM.png?alt=media&#x26;token=4a9d725d-2c93-400a-9b9a-2ff732f09cd6" alt="" data-size="line">to add or remove filters from your preview.

{% hint style="info" %}
**Note:** Filters can be directly typed into the SQL code and be previewed.\
**See:** [Filter using `WHERE`](https://upsolver.gitbook.io/upsolver-1/data-outputs-and-data-transformation/transform-with-sql/transforming-data-with-sql#filter-a-stream-using-the-where-clause)

Alternatively, they can be added through the UI.\
**See:** [Add filters](https://upsolver.gitbook.io/upsolver-1/data-outputs-and-data-transformation/data-transformation-ui/creating-an-output/adding-filters)
{% endhint %}
