最近使用plsql多表关联查询满足条件的数据,最终导出符合条件的单表数据,如下所示:

      

select e.*
  from  emp e,dept p
 where 1 = 1
   and e.deptno = p.deptno
   and p.dname in('SALES','Manager')

    查询员工表满足部门为SALES和Manager的数据,导出

   
plsql多表关联导出数据问题记录
    结果如下

   
plsql多表关联导出数据问题记录
    很正常,但是如果emp(员工表)没有放在from的后面,如下所示

    

select e.*
  from  dept p,emp e
 where 1 = 1
   and e.deptno = p.deptno
   and p.dname in('SALES','Manager')

    导出结果为

   
plsql多表关联导出数据问题记录
    dept 表结构如下

   
plsql多表关联导出数据问题记录
    可以看到,plsql导出的表名直接取了from后面最接近的表名,但字段名是正确的

    很有意思,为什么会这样,暂时不知道,欢迎指教,谢谢

    全文完

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2021-11-30
  • 2021-06-14
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2021-11-29
  • 2021-11-26
  • 2021-08-12
  • 2021-05-24
  • 2021-07-29
  • 2021-04-03
相关资源
相似解决方案