select x.bm,x.mc,c.klxm from
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klb(+);看不出你的sum代表什么,根据上面的意思你自己改一下吧
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klb(+);看不出你的sum代表什么,根据上面的意思你自己改一下吧
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klb(+);看不出你的sum代表什么,根据上面的意思你自己改一下吧
(
select klxm,klbm,count(*) num from c group by klxm,klbm
)d,a,b
where a.jgdm=d.klbm and b.dm=d.klxm
sum是求和。即某大队的扣车或扣证数量
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klb(+)
group by x.bm,x.mc;
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klb(+)
group by x.bm,x.mc;
select x.bm,x.mc,count(c.klxm) from
(
select d.*,b.* from
(
select bm,jgdm from a group by bm,jgdm
) d,b
) x,c
where x.jgdm=c.klbm(+) and x.dm=c.klxm(+)
group by x.bm,x.mc,c.klxm
谢谢大家!尤其是
ORARichard(没钱的日子......)