cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Math MOD function

nmuppa
New Contributor

how to implement MOD (math) functionality in Snaplogic in different
queries as well as using functions

1 ACCEPTED SOLUTION

ForbinCSD
Contributor

@nmuppa - you mentioned queries.

Exactly what are you looking for here?

โ€œ%โ€ is the modulus operator in JavaScript, Ruby, and Python.

If you really mean โ€œqueries,โ€ which database system are you querying?

Microsoft SQL Server uses the % operator as well, AFAICR.
Oracle and PostgreSQL use a MOD() function.
MySQL uses a dyadic MOD operator (dividend MOD divisor).
Other DBMSes may use something entirely different, like โ€œremainderโ€.

Or did you really mean you want to implement a modulus function? From scratch?

View solution in original post

2 REPLIES 2

SpiroTaleski
Valued Contributor

@nmuppa

You can use the mod(โ€œ%โ€) operator.

ForbinCSD
Contributor

@nmuppa - you mentioned queries.

Exactly what are you looking for here?

โ€œ%โ€ is the modulus operator in JavaScript, Ruby, and Python.

If you really mean โ€œqueries,โ€ which database system are you querying?

Microsoft SQL Server uses the % operator as well, AFAICR.
Oracle and PostgreSQL use a MOD() function.
MySQL uses a dyadic MOD operator (dividend MOD divisor).
Other DBMSes may use something entirely different, like โ€œremainderโ€.

Or did you really mean you want to implement a modulus function? From scratch?