Oracle Create View

Oracle Create View

To create a view uses the CREATE VIEW statement.
Oracle view is a logical table based on one or more tables or views. A view contains no data itself.

Create View syntax

CREATE OR REPLACE VIEW view_name AS
	select * from table_name;

CREATE OR REPLACE VIEW view_name AS
	select * from sql_query;

Create View example

CREATE OR REPLACE VIEW cust_view AS
	select * from customers;
	
CREATE OR REPLACE VIEW cust_view2 AS
	select c.* 
	from customers c, old_customers oc
	where c.id=oc.id;