Tag: Open Source

Community

sorted_mode Aggregate Function

(Josh Berkus) So a boolean mode() was very simple to construct, partly because booleans have only three potential values (TRUE, FALSE, NULL). However, in many cases we want mode() for, say, integers. Now, there are several constructions of mode() depending on what statistic you really want, but he

Community

MySQL Triggers with Logging

(Michael McLaughlin) Somebody asked why you can’t implement MySQL triggers that write information when you want to stop the DML statement, like autonomous procedures in Oracle. The question was a surprise but I didn’t find anything on it, so here’s how you can do it.

Community

Five Number Summary

(Scott Noyes) From Freenode: how do you generate a five number summary in MySQL? There is no “median” aggregate function built in. You could do some clever things involving self joins or temporary tables, or build an aggregate UDF – see the comments section in the manual for those approaches.