select * from (
select yebk.fzdm4,left(yebk.fzdm5,1),fzxzl.fzmc,fzxzl.fzdm,sum(yebk.yj1)+sum(yebk.yj2)+sum(yebk.yj3)+sum(yebk.yj4)+sum(yebk.yj5)+sum(yebk.yj6)+sum(yebk.yj7)+
sum(yebk.yj8)+sum(yebk.yj9)+sum(yebk.yj10)+sum(yebk.yj11)+sum(yebk.yj12)+sum(yebk.yj13)-sum(yebk.yd1)-sum(yebk.yd2)-sum(yebk.yd3)-sum(yebk.yd4)-sum(yebk.yd5)
-sum(yebk.yd6)-sum(yebk.yd7)-sum(yebk.yd8)-sum(yebk.yd9)-sum(yebk.yd10)-sum(yebk.yd11)-sum(yebk.yd12)-sum(yebk.yd13)
from gl_fzxzl fzxzl,gl_yebk yebk where
yebk.gsdm='004' and yebk.kjnd='2014' and yebk.zth='004'
and yebk.gsdm=fzxzl.gsdm and yebk.kjnd=fzxzl.kjnd
and yebk.fzdm4=fzxzl.fzdm
and yebk.fzdm5 like '3%'
group by yebk.fzdm4,fzxzl.fzmc,fzxzl.fzdm,left(yebk.fzdm5,1)
) as t order by fzdm4 asc
不知道你这样排的逻辑是什么。只要order by (substr 截取FZDM4 ) 就能实现你说的效果