select JAHR, MONAT, TAG, PSP, PSPDETAIL, USKURZZ, STUNDEN, KOSTEN

   from CCILVD  

  where PSP like CONCAT((select PSPcode from CCTASK where TASKTYPE='JAP' and PROJECT=?),'%') 

               and JAHR=? And MONAT=?

UNION

select JAHR, MONAT,'Summe' as TAG, 'Summe' as PSP, 'Summe' as PSPDETAIL, USKURZZ,

           SUM(STUNDEN) as STUNDEN, SUM(KOSTEN) as KOSTEN

  from  CCILVD 

  where  PSP like CONCAT((select PSPcode from CCTASK where TASKTYPE='JAP' and PROJECT=?),'%') 

                and JAHR=? And MONAT=?

 group by JAHR,MONAT,USKURZZ

UNION

select JAHR, MONAT,'Summe' as TAG, 'Summe' as PSP, 'Summe' as PSPDETAIL, 'Summe' as USKURZZ,

           SUM(STUNDEN) as STUNDEN, SUM(KOSTEN) as KOSTEN

  from  CCILVD 

  where  PSP like CONCAT((select PSPcode from CCTASK where TASKTYPE='JAP' and PROJECT=?),'%') 

                and JAHR=? And MONAT=?

 group by JAHR,MONAT