DROP VIEW LD0VAA0SearchSurveySkills
;

CREATE VIEW LD0VAA0SearchSurveySkills AS 
SELECT U25.*,
       	A.NAMN AS PERSONNAME,
	A.KUNDNUMMER,
       	U01.PERSONNR,
        A.FODDAT,
        A.KON,
	A.ORT,
        A.ADRESS,
    	A.POSTNR,
	A.COADR AS PERSONCOADDRESS,
	Q.KLARTEXT EFTYP_T, 
	Q2.KLARTEXT ERFARFARDIG_T
	FROM LD0V0U25 U25
	LEFT JOIN LD0V0U01 U01 ON U25.KARTLAGGNR = U01.KARTLAGGNR
	LEFT JOIN LD0V0A A ON A.PNR = U01.PERSONNR 
	LEFT JOIN LD0V0Q01 Q 
	ON Q.KODTYP = 'LNEFTYP' 
	AND Q.KOD = U25.EFTYP
	LEFT JOIN LD0V0Q01 Q2 
	ON Q2.KODTYP = 'LNEF' 
	AND Q2.KOD = U25.ERFARFARDIG
;

