Bo's Oracle Station

查看: 1064|回复: 0

分步骤的3表外连接:查询所有员工的工作城市

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2020-9-13 16:57:33 | 显示全部楼层 |阅读模式
  1. select  employee_id, city , department_name from
  2. ( SELECT employee_id, department_name ,d.location_id from  employees e , departments d
  3. where  d.department_id   (+)  = e.department_id   )   a ,  locations l
  4. where a.location_id = l.location_id (+) ;
复制代码
  1. SELECT employee_id, city, department_name
  2. FROM   employees e,   departments d, locations l
  3. where  d.department_id   (+)  = e.department_id  and    d.location_id = l.location_id (+);
复制代码


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-2 23:20 , Processed in 0.040099 second(s), 24 queries .

快速回复 返回顶部 返回列表