I don't know how to filter the attribute table in QGIS. I have two columns, "DN" and "DN_2", both with values from Corine Land Cover (111, 112, 223, etc).

I try to select the rows that have the same value. For example. "DN": 111, and "DN_2": 111, to erase them, and have only values that are different on the same row

enter image description here.

Is there a way to filter this?

2 Answers 2


filter by expression with "DN"="DN_2" ? depending on the column type (string/integer) you could also try an : to_int("DN")=to_int("DN_2")

  • 1
    IS LIKE is another possibility and would omit the to_int.
    – Erik
    Apr 17, 2019 at 10:56

Another solution via using regexp_match() and trim().

Since the match has to be checked both ways means the regexp_match() has to be applied twice using the conjunction AND to achieve the exact match.

regexp_match(trim("DN"), trim("DN_2")) AND regexp_match(trim("DN_2"), trim("DN"))

A Λ B is true only if A is True and B is True

regexp_match(input_string, regex)

Returns true if any part of a string matches the supplied regular expression
input_string the string to test against the regular expression
regex the regular expression to test against


Removes all leading and trailing whitespace (spaces, tabs, etc) from a string

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.