An example of an Oracle all subquery

Source: Internet
Author: User

Problem:
Check out the employee's name, job, and salary, which are higher than the salary of all sales staff.

Analysis:
Any can represent arbitrary, but this problem requires a higher salary than all salespeople, then use a different keyword all.
All is used with the relational operator to represent comparisons with all elements in a subquery.

Code Demo: All subqueries

<span style= "FONT-SIZE:18PX;" >SQL> Select Ename,job,sal from emp  2  where Sal>all (select SAL from emp where job= ' salesman ')  3
  
   /</span>
  


Code parsing:
>all: Larger than all values in the subquery result, that is, larger than the maximum value in the subquery result.
<all is smaller than the minimum value.

The in and not in operators can also be used for subqueries.

An example of an Oracle all subquery

Related Article

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.