I am able to find the rows with longest character following method:
Create new formula field of type NUMBER and insert a simple formula to it that calculates a length of the string
Then query on this field:
Select ... From ... Where FormulaField___c > 20
Here is the reference that I got the above method: SOQL query to find a row with the longest string in a column
But how about Rich Text Field / Long Text Area Field? You know that we cannot create formula field on Rich Text Field / Long Text Area Field.
How can I achieve this?