Hi,
I have written an SQL statement as below.
SELECT GJAHR, SUM(DMBTR) AS "101_DMBTR", SUM(0) as "102_DMBTR" FROM "SAPR3"."MSEG"
where BWART = '101' and werks = '1102'
group by GJAHR
union all
SELECT GJAHR, SUM(0) AS "101_DMBTR", SUM(DMBTR) as "102_DMBTR" FROM "SAPR3"."MSEG"
where BWART = '102' and werks = '1102'
group by GJAHR
order by GJAHR desc;
and the out put i'm getting is
Here i want to club the values into a single row by year but the output i'm getting is into 2 rows.
can anyone suggest me how to solve this issue.
Regards,
Ramana.