UPDATE T41
SET T41.PERSONNR = U10.PERSONNR
FROM LD0P0T41 T41
INNER JOIN LD0P0U34 U34 ON U34.PLANAKTIVITETNR = T41.AGARNR
INNER JOIN LD0P0U30 U30 ON U30.PLANNR = U34.PLANNR
INNER JOIN LD0P0U10 U10 ON U10.INSKRIVNINGSNR = U30.INSKRIVNINGSNR
WHERE T41.AGARTYP IN (64, 74) AND T41.PERSONNR = ''