DROP VIEW LD0V0C45;
CREATE VIEW LD0V0C45
	AS SELECT * FROM LD0P0C45
WHERE EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR
								  JOIN LD0V0ANVANDARE AJD
								  ON AJD.CSSANV=SEKR.CSSANV
								  AND SEKR.PNR=LD0P0C45.BARNPNR)
		OR NOT EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR WHERE SEKR.PNR=LD0P0C45.BARNPNR)
OR EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR
								  JOIN LD0V0ANVANDARE AJD
								  ON AJD.CSSANV=SEKR.CSSANV
								  AND SEKR.PNR=LD0P0C45.MODERPNR)
		OR NOT EXISTS (SELECT 'X' FROM LD0P0SEKR SEKR WHERE SEKR.PNR=LD0P0C45.MODERPNR)
;