重复列 导致的 字段无效

select   z.COMP_ID  from
(select DISTINCT c.*  from comp c left join  
(select  P.COMP_ID , count(P.COMP_ID) as shipc  ,sum(P.CARGO_CAPACITY_REFERENCE)as sumcargo 
from ship p group by P.COMP_ID having P.COMP_ID is not null) v on c.COMP_ID = V.COMP_ID) z ;

猜你喜欢

转载自632928374.iteye.com/blog/2286054
今日推荐