O'Reilly logo

Tera-Tom's 1000 Page e-Book on Teradata Architecture and SQL, 2nd Edition by Tom Coffing, William Coffing

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 31 - View Functions

“It is easier to go down a hill than up it, but the view is much better at the top.”

-Arnold Bennett

Creating a Simple View

images

CREATE View Employee_V  AS
SELECT      Employee_No
           ,First_Name
           ,Last_Name
           ,Dept_No
FROM Employee_Table ; 

The purposes of views are to restrict access to certain columns, derive columns or Join Tables, and to restrict access to certain rows (if a WHERE clause is used).

Basic Rules for Views

1. No ORDER BY inside the View CREATE (some exceptions exist)

2. All Aggregation needs to have an ALIAS

3. Any Derived columns (such as Math) needs an ALIAS

 

Above, are the basic rules of Views with excellent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required