<commit_before>SELECT
    vP.TblPerson_Id AS TblPerson_Id,

    (select vCA.TblAddress_StreetName
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_StreetName,

    (select vCA.TblAddress_StreetNumber
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_StreetNumber,

    (select vCA.TblCity_Name
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_City,

    (select vCA.TblCity_District from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_District,

    (select vCA.TblCity_Code from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_Code,

    (select vCA.TblAddress_County from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_County,

    (select vCA.TblState_Name from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblState_Name,

    (select vCA.TblAddress_Nation from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_Nation,
    -- ----------------------------------------
    (select vCA.TblAddress_StreetName
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_StreetName2,

    (select vCA.TblAddress_StreetNumber
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_StreetNumber2,

    (select vCA.TblCity_Name
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_City2,

    (select vCA.TblCity_District from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_District2,

    (select vCA.TblCity_Code from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_Code2,

    (select vCA.TblAddress_County from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_County2,

    (select vCA.TblState_Name from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblState_Name2,

    (select vCA.TblAddress_Nation from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_Nation2,
    -- ----------------------------------------
    (select
        group_concat(
            concat(
            vCP.TblType_Name,
            ': ',
            vCP.TblPhone_Number,
            case when vCP.TblToPerson_Remark then ' - ' else '' end,
            vCP.TblToPerson_Remark
            ) separator '<br/>'
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactPhone vCP
        where vP.TblPerson_Id = vCP.TblPerson_Id
    ) TblPhone_Number,

    (select
        group_concat(
            concat(
            vCM.TblType_Name,
            ': ',
            vCM.TblMail_Address,
            case when vCM.TblToPerson_Remark <> '' then ' - ' else '' end,
            vCM.TblToPerson_Remark
            ) separator '<br/>'
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
    ) TblMail_Address,

    (select
        group_concat(
            concat(
            vCM.TblMail_Address
            ) separator '; '
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
        and vCM.TblType_Name = 'Privat'
    ) TblMail_AddressPrivate,

    (select
        group_concat(
            concat(
            vCM.TblMail_Address
            ) separator '; '
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
        and vCM.TblType_Name like 'Gesch%ftlich'
    ) TblMail_AddressCompany
<commit_msg>Fix: #SSW-218 Flexible Auswertung<commit_after>SELECT
    vP.TblPerson_Id AS TblPerson_Id,

    (select vCA.TblAddress_StreetName
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_StreetName,

    (select vCA.TblAddress_StreetNumber
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_StreetNumber,

    (select vCA.TblCity_Name
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_City,

    (select vCA.TblCity_District from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_District,

    (select vCA.TblCity_Code from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblCity_Code,

    (select vCA.TblAddress_County from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_County,

    (select vCA.TblState_Name from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblState_Name,

    (select vCA.TblAddress_Nation from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Hauptadresse'
    ) TblAddress_Nation,
    -- ----------------------------------------
    (select vCA.TblAddress_StreetName
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_StreetName2,

    (select vCA.TblAddress_StreetNumber
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_StreetNumber2,

    (select vCA.TblCity_Name
        from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_City2,

    (select vCA.TblCity_District from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_District2,

    (select vCA.TblCity_Code from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblCity_Code2,

    (select vCA.TblAddress_County from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_County2,

    (select vCA.TblState_Name from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblState_Name2,

    (select vCA.TblAddress_Nation from SettingConsumer_{{ ConsumerAcronym }}.viewContactAddress vCA
        where vP.TblPerson_Id = vCA.TblPerson_Id
        and vCA.TblType_Name = 'Zweit-/Nebenadresse'
        LIMIT 0, 1
    ) TblAddress_Nation2,
    -- ----------------------------------------
    (select
        group_concat(
            concat(
            vCP.TblType_Name,
            ': ',
            vCP.TblPhone_Number,
            -- case when vCP.TblToPerson_Remark then ' - ' else '' end, doesn't work if searched
            ' ',
            vCP.TblToPerson_Remark
            ) separator '<br/>'
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactPhone vCP
        where vP.TblPerson_Id = vCP.TblPerson_Id
    ) TblPhone_Number,

    (select
        group_concat(
            concat(
            vCM.TblType_Name,
            ': ',
            vCM.TblMail_Address,
            -- case when vCM.TblToPerson_Remark <> '' then ' - ' else '' end, doesn't work if searched
            ' ',
            vCM.TblToPerson_Remark
            ) separator '<br/>'
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
    ) TblMail_Address,

    (select
        group_concat(
            concat(
            vCM.TblMail_Address
            ) separator '; '
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
        and vCM.TblType_Name = 'Privat'
    ) TblMail_AddressPrivate,

    (select
        group_concat(
            concat(
            vCM.TblMail_Address
            ) separator '; '
        ) from SettingConsumer_{{ ConsumerAcronym }}.viewContactMail vCM
        where vP.TblPerson_Id = vCM.TblPerson_Id
        and vCM.TblType_Name like 'Gesch%ftlich'
    ) TblMail_AddressCompany

{'fraction_non_alphanumeric': 0.09103385178408051, 'fraction_numerical': 0.004666056724611162, 'mean_word_length': 2.49792, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1795503', 'n_tokens_mistral': 3838, 'n_tokens_neox': 3646, 'n_words': 677}