Any,some,all usage in Oracle in Oracle

Source: Internet
Author: User

* Some here to satisfy one of the meanings, is to use or string up the comparative clauses.

* Any also means satisfying one of the meanings, is also the use of or string up the comparative clauses, the difference is that any is generally used in the non-"=" of the comparative relationship, which is also very good understanding, the use of any affirmative sentence in the English use some, this is the same.

* All means satisfying all of its query results, using and strings of comparative clauses.

Any

Nested queries with "any" and nested queries for "some" are the same. Earlier SQL allowed only "any", and later versions, in order to distinguish it from the English "any", introduced "some" and retained the "any" keyword.

Any

Select Emp.empno,emp.ename,emp.job,emp.sal from scott.emp where Sal >any (select Sal from scott.emp where job= ' Manag ER ');

The query process with any is equivalent to the two-step execution process.

(1) Execute "Select Sal from Scott.emp where job= ' manager '"

Select Emp.empno,emp.ename,emp.job,emp.sal from scott.emp where Sal >2975 or sal>2850 or sal>2450;

Some

Some

Select Emp.empno,emp.ename,emp.job,emp.sal from scott.emp where Sal =some (select Sal from scott.emp where job= ' MANAGER ‘);

The nested query with some is the same as the step for any.

(1) Sub-query, execute "Select Sal from scott.emp where job= ' MANAGER '", as shown in result 4.22.

(2) The parent query executes the following statement.

―――――――――――――――――――――――――――――――――――――

Select Emp.empno,emp.ename,emp.job,emp.sal from scott.emp where Sal =2975 or sal=2850 or sal=2450;

All

All is a query, or it can be a subquery

Such as:

Select name from edit

Where name is omitted before all.

All| can be added before name DISTINCT

All is all records.

The distinct is not repeated.

Any,some,all usage in Oracle in Oracle

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.