Can SELECT Statements Be Used on Views?
Page 1 of 1
Can SELECT Statements Be Used on Views?
Select (query) statements can used on views in the same way as tables. The following tutorial
exercise helps you creating a view and running a query statement on the view:
SQL> CREATE VIEW managed_dept AS
SELECT * FROM departments WHERE manager_id IS NOT NULL;
View created.
SQL> SELECT * FROM managed_dept WHERE location_id = 1700;
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
10 Administration 200 1700
30 Purchasing 114 1700
90 Executive 100 1700
100 Finance 108 1700
110 Accounting 205 1700
exercise helps you creating a view and running a query statement on the view:
SQL> CREATE VIEW managed_dept AS
SELECT * FROM departments WHERE manager_id IS NOT NULL;
View created.
SQL> SELECT * FROM managed_dept WHERE location_id = 1700;
DEPARTMENT_ID DEPARTMENT_NAME MANAGER_ID LOCATION_ID
------------- ------------------------------ ---------- -----------
10 Administration 200 1700
30 Purchasing 114 1700
90 Executive 100 1700
100 Finance 108 1700
110 Accounting 205 1700
Similar topics
» What Is a SELECT Query Statement?
» How To Select Some Columns from a Table?
» How To Select Some Rows from a Table?
» What Are DDL Statements?
» How To Select All Columns of All Rows from a Table?
» How To Select Some Columns from a Table?
» How To Select Some Rows from a Table?
» What Are DDL Statements?
» How To Select All Columns of All Rows from a Table?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal