select group_concat( mydt10.mark separator '#') as p01
from mydt10, mydt50
where mydt10.tbl='{imp01->tbl}'
   && mydt10.mark<>''
   && locate( concat('#', mydt10.tbl_nr01, '#'), '{imp01->pcor}')>0
   && mydt10.invtype=mydt50.p00
   && mydt50.p103=1
group by null;