SQLite Forum

Proposal: Implement the MOD(x, y) function
Login

Proposal: Implement the MOD(x, y) function

(1.2) By tarest on 2021-04-15 10:15:32 edited from 1.1 [source]

I compared scalar SQL functions in 5 different RDBMS: PostgreSQL, MySQL, Oracle, SQL Server and SQLite, and also in the ANSI SQL Standard. There are large differences among different RDBMS, and I propose to reduce them a little bit.

The ANSI SQL Standard defines the MOD(x, y) function which returns division remainder. It is already implemented in PostgreSQL, MySQL, and Oracle. Currently, SQL Server and SQLite implement only modulo operator: x % y.

For more information about comparing implementations of the scalar functions, click here: https://github.com/iwis/SQL-notes/blob/master/Functions.txt

(2) By Larry Brasfield (larrybr) on 2021-04-15 10:22:32 in reply to 1.2 [link] [source]

Have you proposed this despite such a function already existing in SQLite? Or do you find some deficiency in the implementation? If that's the case, please be specific.

(3) By anonymous on 2021-04-15 16:06:56 in reply to 2 [link] [source]

I think OP is still using a pre 3.35 version .....

(4) By ThanksRyan on 2021-04-15 16:46:56 in reply to 1.2 [link] [source]

See the 3.35.0 release notes:

Item number one:

Added built-in SQL math functions(). (Requires the -DSQLITE_ENABLE_MATH_FUNCTIONS compile-time option.)