SELECT *
FROM 
(    SELECT a62.*, 
            0 as packpos,
            ifnull(a90.nr01, 0) as a90nr01, 
            ifnull(a90.p30, '') as a90p30 
     FROM a62 
     LEFT JOIN a90 ON a90.tbl='a62'
                   && a90.tbl_nr01=a62.nr01    
     WHERE a62.p00={p_a60parag}      
        && a62.v103>a62.v109 
     GROUP BY a62.nr01   
) as tbl01
ORDER BY vd100, nr01;
