半链接和关联转换
来源:互联网 发布:用户上下级数据库设计 编辑:程序博客网 时间:2024/04/30 18:44
SQL> select department_namefrom hr.departments deptwhere department_id IN (select department_id from hr.employees emp); 2 3 DEPARTMENT_NAME------------------------------AdministrationMarketingPurchasingHuman ResourcesShippingITPublic RelationsSalesExecutiveFinanceAccounting已选择11行。SQL> select department_name from hr.departments dept, hr.employees emp where dept.department_id = emp.department_id; 2 3 DEPARTMENT_NAME------------------------------AdministrationMarketingMarketingPurchasingPurchasingPurchasingPurchasingPurchasingPurchasingHuman ResourcesShippingDEPARTMENT_NAME------------------------------ShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingDEPARTMENT_NAME------------------------------ShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingDEPARTMENT_NAME------------------------------ShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingDEPARTMENT_NAME------------------------------ShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingShippingDEPARTMENT_NAME------------------------------ITITITITITPublic RelationsSalesSalesSalesSalesSalesDEPARTMENT_NAME------------------------------SalesSalesSalesSalesSalesSalesSalesSalesSalesSalesSalesDEPARTMENT_NAME------------------------------SalesSalesSalesSalesSalesSalesSalesSalesSalesSalesSalesDEPARTMENT_NAME------------------------------SalesSalesSalesSalesSalesSalesSalesExecutiveExecutiveExecutiveFinanceDEPARTMENT_NAME------------------------------FinanceFinanceFinanceFinanceFinanceAccountingAccounting已选择106行。SQL> select distinct department_name from hr.departments dept, hr.employees emp where dept.department_id = emp.department_id; 2 3 DEPARTMENT_NAME------------------------------AdministrationAccountingPurchasingHuman ResourcesITPublic RelationsExecutiveShippingSalesFinanceMarketing已选择11行。IN半链接改成关联,就得去从那从2个表返回数据呢?能改写成半链接吗?SQL> select distinct dept.department_name,emp.department_id from hr.departments dept, hr.employees emp where dept.department_id = emp.department_id; 2 3 DEPARTMENT_NAME DEPARTMENT_ID------------------------------ -------------Marketing 20Accounting 110Human Resources 40IT 60Administration 10Executive 90Public Relations 70Finance 100Purchasing 30Shipping 50Sales 80已选择11行。SQL> select dept.department_name, emp.department_id from hr.departments dept where dept.department_id in (select emp.department_id from hr.employees emp) 2 3 4 ;select dept.department_name, emp.department_id *第 1 行出现错误:ORA-00904: "EMP"."DEPARTMENT_ID": 标识符无效从多个表返回数据的关联,无法改成半链接。
0 0
- 半链接和关联转换
- 半链接改写成关联
- 以往链接关联
- Dreamweaver CS6链接ACCESS数据库 绝对路径和相对路径转换
- 迅雷专用链接和旋风专用链接编码及转换方法
- 迅雷专用链接和旋风专用链接编码及转换方法(摘抄)
- 关联和非关联查询
- 关联删除和关联更新
- 关联数组转换索引数组
- 自定义Layout xml文件转换成View对象和Activity关联的实现
- 自定义Layout xml文件转换成View对象和Activity关联的实现
- 看电视*实现看电视和转换电视频道的功能*【对象数组.类的关联关系】
- Android Studio 关联项目软链接
- sql左链接三表关联
- URL长链接转换为短链接
- 长链接转换为短链接
- 搜狗微信临时链接转换为永久链接
- Hibernate的单向关联和双向关联
- no XXX in java.library.path的解决办法
- phoenix代码分析
- 北漂梦归传智播客,成长无极限
- Windows上使用Git前需要进行的操作
- 【容易打工网】办公室礼仪 职场生存十八定律
- 半链接和关联转换
- 一个IT男的创业感言
- 验证码识别浅谈
- 【代码备忘】火狐浏览器插件xpi自动从网站下载安装的代码
- java串口编程配置问题解决
- float/double无效值处理
- 用户态切换到内核态(May 22)
- 每个程序员都必读的12篇文章
- Android各种长度单位