

It's important to note that the output from the view is not a snapshot from the moment you created the view if the underlying source table were updated, perhaps to add Montpelier, those updates would automatically be reflected in the view. You could now use this view any time you want to work with state capitals. The Data Output pane will re-fill with the results of having ‘run’ the view.

After confirming that the query returns the correct rows, copy the SQL to your computer's clipboard (Ctrl-C).(Sorry Montpelier, I guess you were too small.) SELECT * FROM usa.cities WHERE capital = 1 ORDER BY stateabb In the pgAdmin Query dialog, execute the following query (which identifies the state capitals):.

Create a view based on attribute criteria In this section, we'll see how views can be created in Postgres. In Postgres and other sophisticated RDBMSs, stored SQL statements like these are called views. In Lesson 1, we saved a number of our MS-Access queries so that we could easily re-run them later and, in a couple of cases, to build a query upon another query rather than a table.
