codak-mysql (source)

wauter
There is a newer version of this page. You can find it here.

The CoDAK MySQL extension adds codak_product, a MySQL User-defined Function (UDF), to MySQL.

codak_product is an aggregate function which calculates the product of its arguments. Null values are ignored.

Input parameters:

  • values (real)

Output:

  • product of the values (real)

Usage example:

mysql> CREATE TABLE test_values (value REAL NULL);
Query OK, 0 rows affected (0.13 sec)

mysql> INSERT INTO test_values VALUES(1),(5),(NULL),(0.1);
Query OK, 4 rows affected (0.04 sec)
Records: 4  Duplicates: 0  Warnings: 0

mysql> SELECT codak_product(value) FROM test_values;
+----------------------+
| codak_product(value) |
+----------------------+
|           0.50000000 |
+----------------------+
1 row in set (0.01 sec)

mysql>

MongoDB Logo MongoDB