When you create a regular view, the database server stores the view definition in the database; no data is stored for the view. Instead, the view definition is executed only when it is referenced, and only for the duration of time that the view is in use. This means that creating a view does not require storing duplicate data in the database.
Connect to the database as a user with DBA authority.
In the left pane, right-click Views and choose New » View.
Follow the instructions in the Create View Wizard.
In the right pane, click the SQL tab to edit the view definition. To save your changes, choose File » Save.
Connect to a database.
Execute a CREATE VIEW statement.
Create a view called DepartmentSize that contains the results of the SELECT statement given earlier in this section:
CREATE VIEW DepartmentSize AS SELECT DepartmentID, COUNT(*) FROM Employees GROUP BY DepartmentID;
|Envoyer votre avis sur cette page par email.||Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1|