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