DROP VIEW LD0V0H
;
CREATE VIEW LD0V0H
      AS SELECT * FROM LD0P0H H
		  WHERE EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR
									  JOIN LD0V0ANVANDARE AJD
									  ON AJD.CSSANV=SEKR.CSSANV
									  AND SEKR.PNR=H.PNR)
								OR NOT EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR WHERE SEKR.PNR=H.PNR)
;
