-
Book Overview & Buying
-
Table Of Contents
Amazon Redshift Cookbook
By :
View database objects allow the result of a query to be stored. In Amazon Redshift, views run each time the view is mentioned in a query. The advantage of using a view instead of a table is that it can allow access to only a subset of data on a table, join more than one table into a single virtual table, and act as an aggregated table, and it takes up no space on the database since only the definition is saved, hence making it convenient to abstract complicated queries. In this recipe, we will create views to store queries for the underlying tables.
To complete this recipe, you will need everything mentioned in the Technical requirements section at the start of the chapter.
Let’s create a view using the CREATE VIEW command. We will use the following steps to create a view:
finance.customer_vw view based on the results of the query on finance.customer:
CREATE VIEW finance...