oracle: column ambiguously defined

分页查询

column ambiguously defined   未明确定义的列

select *
  from (select abc.*, rownum m
          from (select t.oid,
                       t.clues_code,
                       t.clues_name,
                       t.customer_name,
                       (select a.fullname
                          from ecc_prm_areainfo a
                         where a.ennable_flag = 'T'
                           and a.oid = t.area) area,
                       (select to_char(wmsys.wm_concat(o.name))
                          from ecc_tcm.ecc_prm_program o
                         where o.enable_flag = 'T'
                           and o.oid = t.industry) industry,
                       (select to_char(wmsys.wm_concat(p.product_name))
                          from ecc_tcm.ecc_prm_product p
                         where p.enable_flag = 'T'
                           and t.product = p.product_id) product,
                       t.flow_type,
                       cn.flow_oid
                  from ecc_tcm.table1  t,
                 where t.clues_state = 2
                   and t.enable_flag = 'T'
         
                 order by clues_code ASC) abc
         where rownum <= 10)
 where m > 0


这句语句正常

select t.oid,
                       t.clues_code,
                       t.clues_name,
                       t.customer_name,
                       (select a.fullname
                          from ecc_prm_areainfo a
                         where a.ennable_flag = 'T'
                           and a.oid = t.area) area,
                       (select to_char(wmsys.wm_concat(o.name))
                          from ecc_tcm.ecc_prm_program o
                         where o.enable_flag = 'T'
                           and o.oid = t.industry) industry,
                       (select to_char(wmsys.wm_concat(p.product_name))
                          from ecc_tcm.ecc_prm_product p
                         where p.enable_flag = 'T'
                           and t.product = p.product_id) product,
                       t.flow_type,
                       cn.flow_oid
                  from ecc_tcm.table1  t,
                 where t.clues_state = 2
                   and t.enable_flag = 'T'
         
                 order by clues_code ASC


出错就在

select *
  from (select abc.*, rownum m
          from abc

where rownum <= 10)
 where m > 0


多数是里面的列重复引起的,可以给相同列起别名





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值