Ron Stevens <sqlite-Y9FGH9USQxS1Z/[EMAIL PROTECTED]> wrote:
I have a custom function that compares two text values and returns 1
if they're equal based on an algorithm that's not strictly text
comparison and 0 if they don't match. I want to do a query that
groups all rows that match using my custom function into a single
group. Is that possible?

What you really need is a custom function that produces a "canonical representation" for all the strings in the same equivalence class under your equivalence relation. That is, a function CR(s) such as for every s1 and s2, s1 ~ s2 if and only if CR(s1) = CR(s2). Here '~' is your equivalence relation, '=' is the usual byte-wise comparison. E.g. if '~' is a case-insensitive comparison, then CR(s) could return s converted to all lowercase (or all uppercase).

Once you have such a function, you can simply GROUP BY CR(fieldName).

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to