When you retrieve data through a view, SAP ASE verifies that all the database objects referenced anywhere in the statement exist and that they are valid in the context of the statement. If the checks are successful, SAP ASE combines the statement with the stored definition of the view and translates it into a query on the view’s underlying tables.
This process is called view resolution.
Consider the following view definition statement and a query against it:
create view hiprice as select * from titles where price > $15 and advance > $5000 select title, type from hiprice where type = "popular_comp"
Internally, SAP ASE combines the query of hiprice with its definition, converting the query to:
select title, type from titles where price > $15 and advance > $5000 and type = "popular_comp"
In general, you can query any view in any way just as if it were a real table. You can use joins, group by clauses, subqueries, and other query techniques on views, in any combination. However, if the view is defined with an outer join or aggregate function, you may get unexpected results when you query the view.