How does mysql implement the DISTINCT keyword with its own aggregate functions? Can it be used in a UDF in the same way?
SELECT MY_UDF(DISTINCT value) FROM table
If so, does MySQL apply the DISTINCT before passing a group of rows to the UDF, or does the UDF itself have to handle it? And what happens with UDFs that take more than one argument? Does it distinct the whole tuple of inputs?
I tried, and in MySQL, including the DISTINCT keyword in a UDF call is a syntax error. So I think it is not possible.