Originally Posted by jcs32
Although slightly off-topic I would say we are both right, depending on the interpretation.
there especially "Under the standard rules for arithmetic on integers, rational numbers, real numbers and complex numbers, division by zero is undefined. Division by zero must be left undefined in any mathematical system that obeys the axioms of a field."
Hrm. A quick google (ansi sql divide by zero) shows that ANSI SQL92 apparently requires that division by zero is an error. Unfortunately, http://troels.arvin.dk/db/rdbms/
doesn't tell us what most databases do, though that google search tends to indicate that Sybase and MSSQL are the only two that give you an option here (which at least on MSSQL defaults to divide by zero is an error). Google shows that Oracle, DB2, Firebird and (I think) SQLite all consider 5/0 an error. So even if math folks have decided that division by zero is undefined, databases certainly feel it an error (actually computers in general deem it to be an error). So, yet another case where MySQL throws out the standards for no good reason. If they had wanted to allow this for people who it would make life easier on, the correct way would have been to provide an option to allow divide by zero = NULL, and have it default to off (ie: what MSSQL does). But MySQL has never seemed to be interested in doing things the right way.