Search code examples
ldapldap-query

LDAP - filter records with two attributes equal (or different)


I want to filter LDAP records to find entries with two attributes equal (also different).

Let us assume we have records with userid.

userid=10

userid=15

Each record have name and surname and I want to filter people with identical name and surname.

I can filter people with a particular name using following filter

(&(name=Mark)(surname=Mark))

But this filter is not correct

(=(name)(surname))

nor this

name=surname

Solution

  • This is not possible in LDAP. LDAP does not support relational queries even on the attribute level of the same entry.

    See LDAP Query Basics.