Use CREATE VIEW for creating views and DROP VIEW for dropping them.
By default, views act as virtual tables that are persisted at time of first use. Addding NOCACHE after the first SELECT will cause the view to be evaluated and run on demand and not persisted. Otherwise, it will follow the default caching behavior.
Example:
create view MyView as select * from Orders union all select * from orders
create view MyView as select NOCACHE * from Orders union all select * from orders

  • No labels