DROP VIEW LD0V4U99;
;

CREATE VIEW LD0V4U99 AS  
SELECT DISTINCT
       A.EXTTEXT NIVA1_EXTEXT, 
       B.EXTTEXT NIVA2_EXTEXT, 
       C.EXTTEXT NIVA3_EXTEXT, 
       C.EXTKOD NIVA3_EXTKOD
FROM LD0V0U99 A, 
     LD0V0U99 B, 
     LD0V0U99 C
WHERE A.EXTKODTYP = 4 
  AND B.EXTKODTYP = 4 
  AND C.EXTKODTYP = 4 
  AND A.NIVA = 1 
  AND B.NIVA = 2 
  AND C.NIVA = 3 
  AND(A.EXTKOD = SUBSTRING(B.EXTKOD,1,1) 
  AND B.EXTKOD = SUBSTRING(C.EXTKOD,1,2));
;
