共3年的数据
那么
select dm,
       sum(isnull(case when convert(char(4),rq,120)='2002' then je end,0)) as '2002je',
       sum(isnull(case when convert(char(4),rq,120)='2003' then je end,0)) as '2003je',
       sum(isnull(case when convert(char(4),rq,120)='2004' then je end,0)) as '2004je',
       lb
from 表
group by dm,lb