skip to main content
Designing and coding the IP : Views : Queries on a view
 

Queries on a view

Users can query the view just the same way they query any base table. Views are not updateable and do not support INSERT, UPDATE and DELETE operations. Views can be queried in a simple query, a join query, or a subquery.

Example queries on views

Simple query
SELECT * FROM emp_payroll
SELECT * FROM emp_payroll ORDER BY total_pay
Join Query
SELECT info.deptno, d.deptname, info.emp_count FROM dept d, dept_info info WHERE d.deptno = info.deptno
Subquery
SELECT * FROM emp WHERE empno IN (SELECT empno FROM emp_high_pay)