首页 > 其他 > 详细

子查询

时间:2020-06-19 19:58:44      阅读:47      评论:0      收藏:0      [点我收藏+]

当进行一个查询时,需要的条件或者数据要用另一个select语句得结果

可分为两种:

第一种:where

1.单值:

#select name,salary from employee where salary=(select max(salary) from employee)

2.多值:

# select name,salary from employee where salary in (select salary from employee where name in (‘a‘,‘b‘,‘c‘))

# select name,salary from employee where salary =any (select salary from employee where name in (‘a‘,‘b‘,‘c‘))

子查询

原文:https://www.cnblogs.com/hapyygril/p/13164541.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!