Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle- subquery

2025-03-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Subquery in WHERE condition

1. What are the employees who earn more than black?

Select ename

From emp

Where sal > (select sal from emp where ename='BLAKE')

two。 What are the employees with a maximum wage higher than 30 departments?

Select ename,sal

From emp

Where sal > (select max (sal) from emp where deptno=30)

Select ename,sal

From emp

Where sal > all (select sal from emp where deptno=10);-any

3. When all is followed by a subquery

"x = ALL (...)": The value must match all the values in the list to evaluate to TRUE. All values must match

"x! = ALL (...)": The value must not match any values in the list to evaluate to TRUE. At least one value does not match.

"x > ALL (...)": The value must be greater than the biggest value in the list to evaluate to TRUE. Greater than the maximum value

"x

< ALL (...)": The value must be smaller than the smallest value in the list to evaluate to TRUE.小于最小的值 "x >

= ALL (...) ": The value must be greater than or equal to the biggest value in the list to evaluate to TRUE. Greater than or equal to the maximum value

"x ANY (...)": The value must be greater than the smallest value in the list to evaluate to TRUE. Greater than the minimum

"x

< ANY (...)": The value must be smaller than the biggest value in the list to evaluate to TRUE.小于最大值 "x >

= ANY (...) ": The value must be greater than or equal to the smallest value in the list to evaluate to TRUE. Greater than or equal to the minimum value

"x

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report