Oracle 4: View

Source: Internet
Author: User

View: A query statement that can correspond to one or more tables

-- create a view without querying payroll Create or Replace View V_normal  as Select e.empno,e.ename,e.job,e.mgr,e.hiredate  from EMP E Order  by E.hiredate
--Query results as a table to correlate queries--Views: Shows the average salary, department number, department name, average salary for each departmentCreate or Replace ViewV_avg asSelectRes.*, D.dname from(SelectE.deptno,avg(SAL) fromEMP EGroup  byE.deptno) res,dept DwhereRes.deptno=D.deptno
With Read only
--View becomes read-only

Sequence:

Oracle database provides an object called sequence

Sequence: is an object that stores a numeric value that can be set initially (default is 1) to set the next value more than the previous value (default is 1), each time the resulting value is different

--Create a sequenceCreatesequence Seq_noincrement by TenStart with  -Cache -Select *  fromDept--inserting data using department sequencesInsert  intoDeptValues(Seq_no.nextval,'Develop A','Earth')--Query SequenceSelectSeq_no.currval fromDual

Oracle 4: View

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.