select 
       if(sala02_11.nr01_1=0, 'ΟΜΑΔΑ', 'ΠΩΛΗΤΗ') as p00, 
       sala02_11.p04 as p04, 
       sala02_11.p05 as p05, 
       sala02_11.p101 as p101, 
       sum(sala02_11.poso) as poso, 
       sala02_11.us0p01 as us0p01, 
       sala02_11.p02 as p02, 
       if(i20.p2 is null, '', i20.p2) as vp02, 
       sala02_11.p03 as p03, 
       if(i00.name is null, '', i00.name) as vp03

FROM sala02_11
LEFT JOIN i00 ON i00.pno=sala02_11.p03
LEFT JOIN i20 ON i20.p1=sala02_11.p02

WHERE sala02_11.p04<='{odbcdtos(date())}'
   && sala02_11.p05>='{odbcdtos(date())}'
   && sala02_11.us0p01='{p_aususr}'
   && sala02_11.p103=1
GROUP BY sala02_11.nr01_1, sala02_11.nr01_2;