DROP VIEW LD0V1T41
;
CREATE VIEW LD0V1T41
AS SELECT * FROM LD0P0T41 T41
WHERE EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 21)
   OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 22)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 23)
   OR EXISTS (SELECT 'X' FROM LD0V0H H 
		WHERE H.AKTUALNR = T41.AGARNR AND
		      T41.AGARTYP = 20)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
   		WHERE L.RESURSNR = T41.AGARNR AND
		      T41.AGARTYP = 38)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
		WHERE L.UPPDRNR = T41.AGARNR AND
		      T41.AGARTYP = 25)
   OR EXISTS (SELECT 'X' FROM LD0V0A70 A70 
		WHERE A70.FLYKTNR = T41.AGARNR AND
		      T41.AGARTYP = 40)
   OR EXISTS (SELECT 'X' FROM LD0V0A700 A700 
		WHERE A700.FLYKTNR = T41.AGARNR AND
		      T41.AGARTYP = 40)
   OR EXISTS (SELECT 'X' FROM LD0V0B B 
		WHERE B.AKTNR = T41.AGARNR AND
		      T41.AGARTYP = 39)
   OR EXISTS (SELECT 'X' FROM LD0V0E30 E30 
		WHERE E30.ATERLNR = T41.AGARNR AND
		      T41.AGARTYP = 44)
   OR EXISTS (SELECT 'X' FROM LD0V0U10 U10 
		WHERE U10.INSKRIVNINGSNR = T41.AGARNR AND
		      T41.AGARTYP=30)
   OR EXISTS (SELECT 'X' FROM LD0V0U30 U30 
		WHERE U30.PLANNR = T41.AGARNR AND
		      T41.AGARTYP=32)
   OR EXISTS (SELECT 'X' FROM LD0V1U60 U60 
		WHERE U60.PRAKPROJNR = T41.AGARNR AND
		      T41.AGARTYP IN (33, 34, 35, 36))
   OR EXISTS (SELECT 'X' FROM LD0V0N90 N90 
		WHERE N90.UPPDRAGNR = T41.AGARNR AND
		      T41.AGARTYP=46)
   OR EXISTS (SELECT 'X' FROM LD0V0L L 
		WHERE L.RESURSNR = T41.AGARNR AND
			  T41.AGARTYP = 47)
   OR EXISTS (SELECT 'X' FROM LD0V2U90 U90 
		WHERE U90.LNUPPDRAGNR = T41.AGARNR AND
		      T41.AGARTYP = 48)
   OR EXISTS (SELECT 'X' FROM LD0V0C C
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 42)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 41)
   OR EXISTS (SELECT 'X' FROM LD0V0B B 
		WHERE B.AKTNR = T41.AGARNR AND
		      T41.AGARTYP = 45)
   OR EXISTS (SELECT 'X' FROM LD0V0H H 
		WHERE H.AKTUALNR = T41.AGARNR AND
		      T41.AGARTYP = 60)
   OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 61)
   OR EXISTS (SELECT 'X' FROM LD0V0U01 U01
		WHERE U01.KARTLAGGNR = T41.AGARNR AND
		      T41.AGARTYP = 62)
    OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 51)
   OR EXISTS (SELECT 'X' FROM LD0V0C C 
		WHERE C.AEVERKNR = T41.AGARNR AND
		      T41.AGARTYP = 52)
   OR EXISTS (SELECT 'X' FROM LD0V0C20 C20 
		WHERE C20.INSNR = T41.AGARNR AND
		      T41.AGARTYP = 53)
   OR EXISTS (SELECT 'X' FROM LD0V0N900 N900 
		WHERE N900.UPPDRAGIFONR = T41.AGARNR AND
		      T41.AGARTYP = 63)
   OR EXISTS (SELECT 'X' FROM LD0V0U34 U34 
		WHERE U34.PLANAKTIVITETNR = T41.AGARNR AND
		      T41.AGARTYP IN (64,74))
   OR EXISTS (SELECT 'X' FROM LD0V0U70 U70 
		WHERE U70.ENKELPLATSNR = T41.AGARNR AND
		      T41.AGARTYP = 66)
   OR EXISTS (SELECT 'X' FROM LD0V0N900 N900 
		WHERE N900.UPPDRAGIFONR = T41.AGARNR AND
		      T41.AGARTYP = 68)
   OR EXISTS (SELECT 'X' FROM LD0V0U90 U90 
		WHERE U90.LNUPPDRAGNR = T41.AGARNR AND
		      T41.AGARTYP=69)
   OR EXISTS (SELECT 'X' FROM LD0V0U10 U10 
		WHERE U10.INSKRIVNINGSNR = T41.AGARNR AND
		      T41.AGARTYP=70)
   OR EXISTS (SELECT 'X' FROM LD0V0U35 U35 
		WHERE U35.PLATSNR = T41.AGARNR AND
		      T41.AGARTYP=71)
;


