AS SELECT Clause

Description

You can change the SELECT query defined in the virtual table by using the AS SELECT clause in the ALTER VIEW statement. This function is working like the CREATE OR REPLACE statement. You can also change the query by specifying the query number 1 in the CHANGE QUERY clause of the ALTER VIEW statement.  

Syntax

ALTER [ VIEW | VCLASS ] view_name AS select_statement

Example

ALTER VIEW b_view AS SELECT * FROM a_tbl WHERE phone IS NOT NULL;

SELECT * FROM b_view;

 

           id  phone

===================================

            1  '111-1111'

            2  '222-2222'

            3  '333-3333'