分页查询
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
多数是里面的列重复引起的,可以给相同列起别名