21. Create a modification view

Create/modify views
1. Create view
create view view name as select statement [with read only]
//Add with read only to indicate that the newly created view can only be read and cannot be changed .

Instance
SQL> create view myview as select * from emp where sal< 1000;
View created

SQL> select * from myview;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- -- --------- --------- --------- ------
 7369 SMITH CLERK 7902 1980/12/17 800.00 20
 7900 JAMES CLERK 7698 1981/ 12/3 950.00 30



2. Create or modify the view
create or replace view view name as select statement [with read only]
//Adding with read only means that the newly created view can only be read and cannot be changed

3. Delete the view
drop view

when the view name is The table structure is too complex, use the view to solve

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327009619&siteId=291194637
21.