Skip to content
Snippets Groups Projects
Unverified Commit 799b7df3 authored by Jeff Bruemmer's avatar Jeff Bruemmer Committed by GitHub
Browse files

docs- sql sidebar (#41442)

parent 815ac5c7
No related branches found
No related tags found
No related merge requests found
docs/questions/images/sql-sidebar.png

193 KiB

docs/questions/images/view-the-sql.png

110 KiB

......@@ -218,7 +218,22 @@ The row limit step lets you limit how many rows you want from the previous resul
## Viewing the SQL that powers your question
Under the hood, all Metabase questions are SQL (gasp!). If you're curious to see the SQL that will get run when you ask your question, you can click the little console icon in the top-right of the notebook editor. In the modal that opens up, you'll also be given the option to start a new query in the SQL editor using this generated SQL as a starting point (assuming you have [SQL permissions](../../permissions/data.md#native-query-editing) to that database). It's a nice little shortcut to have Metabase write some boilerplate SQL for you, but then allows you to tweak and customize the query.
![View the SQL](../images/view-the-sql.png)
Under the hood, all Metabase questions are SQL (gasp!). To view the SQL that Metabase will run when you click **Visualize**, click the little **Console** icon in the top right of the query builder. Metabase will preview the SQL in a sidebar:
![SQL sidebar](../images/sql-sidebar.png)
To view the SQL, you must have [query builder and native permissions](../../permissions/data.md).
### Convert query builder question to SQL
You can also convert the question to a [native editor question](../native-editor/writing-sql.md). From the query builder screen:
1. Click the **Console** icon in the upper right of the query builder.
2. Click **Convert the question to SQL** option in the bottom right below the SQL code.
Conversion is a one-way street: you can't convert a SQL question back into a query builder question.
## Play around with saved questions
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment