一个SQL语句的题目遇到问题了求解答 select rq,(如果这里写上xm,max(n)就没效果),max(n) from (select rq,(select xm from ryb r,jkjl j where r.gh=j.gh)xm,max(n) from (select extract(year from rq) rq ,r.xm,
(sum(case when fx=0 then je else 0 end)-sum(case when fx=1 then je else 0 end)) n
from jkjl j,ryb r where j.gh=r.gh group by r.xm,extract(year from rq))group by rq)group by rq