![]() | |
#11
| |||
| |||
|
|
The MOD() function in various SQL products works differently. *I need to update a table in SQL FOR SMARTIES. Mind helping me out? *Tell me the name and release of your SQL, and the results of these function calls. |
#12
| |||
| |||
|
|
The MOD() function in various SQL products works differently. I need to update a table in SQL FOR SMARTIES. Mind helping me out? Tell me the name and release of your SQL, and the results of these function calls. .... I originally found three different approaches to this problem. Answers were 2, -2, NULL, error, 3, -3, 12 and -12. I just hope that things are more consistent today. |
#13
| |||
| |||
|
|
Teradata 12.00.03.07, same results for any other release: MOD (12, 5) = 2 MOD(-12, 5) = -2 MOD (-12, -5) = -2 MOD (12, -5) = 2 MOD (NULL, 5) = NULL MOD (NULL, NULL) = NULL MOD (12, NULL) = NULL MOD (12, 0) = Failure 2650 Numeric processor operand error. MOD (-12, 0) = Failure 2650 Numeric processor operand error. MOD (0, 5) = 0 MOD (0, -5) = 0 MOD (0, 0) = Failure 2650 Numeric processor operand error. |
#14
| |||
| |||
|
|
--CELKO-- <jcelko212 (AT) earthlink (DOT) net> wrote in news:0ea81dbb-8093-41ce-b7a7- a18c4f2f24db (AT) g19g2000yqc (DOT) googlegroups.com: The MOD() function in various SQL products works differently. I need to update a table in SQL FOR SMARTIES. Mind helping me out? Tell me the name and release of your SQL, and the results of these function calls. ... I originally found three different approaches to this problem. Answers were 2, -2, NULL, error, 3, -3, 12 and -12. I just hope that things are more consistent today. Another case that may give different results is MOD(NULL,0). Mimer SQL returns NULL. |
#15
| |||
| |||
|
|
On 2010-06-10 07:51, Jarl Hermansson wrote: --CELKO-- <jcelko212 (AT) earthlink (DOT) net> wrote in news:0ea81dbb-8093-41ce-b7a7- a18c4f2f24db (AT) g19g2000yqc (DOT) googlegroups.com: The MOD() function in various SQL products works differently. I need to update a table in SQL FOR SMARTIES. Mind helping me out? Tell me the name and release of your SQL, and the results of these function calls. ... I originally found three different approaches to this problem. Answers were 2, -2, NULL, error, 3, -3, 12 and -12. I just hope that things are more consistent today. Another case that may give different results is MOD(NULL,0). Mimer SQL returns NULL. db2 9.5 returnes null in this case as well |
#16
| |||
| |||
|
#17
| |||
| |||
|
|
returns: |
#18
| |||
| |||
|
|
Otherwise, the result is the unique non-negative exact numeric value r with scale zero such that 1)r has the same sign as n. |
#19
| |||
| |||
|
|
On 2010-06-11 01:03, --CELKO-- wrote: [...] Otherwise, the result is the unique non-negative exact numeric value r with scale zero such that 1)r has the same sign as n. For negative n should r be positive or negative? |
#20
| |||
| |||
|
|
returns: a, b, c, d, e, f, g, h, i, j, k, l 2,-2,-2, 2, , , , , , 0, 0, Are the comma/empty strings to show NULLs, errors, or something else? |
![]() |
| Thread Tools | |
| Display Modes | |
| |