Select nested Query

Source: Internet
Author: User
Select nested query without source code and Demonstration: source code source -- single-row subquery selectename, sal, deptnofromempwheredeptno (distinct) selectename, sal, deptnofromempwheredeptno (distinct) -- multiple lines

Select nested query without source code and Demonstration: source code source -- select ename, sal, deptno from emp where deptno = (select deptno from emp where ename = 'Scott ') select ename, sal, deptno from emp where deptno = (select deptno from emp where ename = 'Scott ') -- multiple rows

Select nested Query <无>

Source code and demo:Source code

-- Select ename, sal, deptno from emp where deptno = (select deptno from emp where ename = 'Scott ') select ename, sal, deptno from emp where deptno = (select deptno from emp where ename = 'Scott ') -- select ename, sal, deptno, job from emp where job in (select distinct job from emp where deptno = 10) select ename, sal, deptno, job from emp where sal> all (select sal from emp where deptno = 30) select ename, sal from emp where deptno = 30 select ename, sal, deptno, job from emp where sal> any (select sal from emp where deptno = 30) -- Multi-column subquery select ename, sal, deptno, job from emp where (deptno, job) = (select deptno, job from emp where ename = 'Smith ') update empset sal = 1500, comm = 30 where ename = 'clark' select ename, sal, comm from emp where ename = 'clark' select ename, sal, comm, deptno from emp where (sal, nvl (comm,-1) in (select sal, nvl (comm, -1) from emp where deptno = 30) select ename, sal, comm from emp where deptno = 30 select ename, sal, comm, deptno from emp where sal in (select sal from emp where deptno = 30) and nvl (comm,-1) in (select nvl (comm,-1) from emp where deptno = 30)

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.