Creating a view from an SQL script¶
Once you have a SELECT query working the way you want on the SQL tab, you can save it as a view so you can reuse it by name.
To turn a script into a view:
- Select the whole script and copy it to the clipboard (Ctrl+A, then Ctrl+C).
- Choose Object → New View from the main menu, or New View from the tree panel's pop-up menu.
- Paste the script into the View Body box.
- Enter a name for the view.
- To create a temporary view, tick Temporary view.
- Click Apply.
Tip
Make sure every column your query returns has a clear name (use AS aliases for computed columns) before saving it as a view — see the note in Creating a view and Known Issues.
See also: Creating a view · Generating views using the Query Builder