Author | Message |
---|---|
HelloWorld
Posts: 88
|
Posted 02:22 Jul 18, 2009 |
ERROR: operator does not exist: real % integer |
cysun
Posts: 2935
|
Posted 09:15 Jul 18, 2009 |
A floating point number, e.g. 10.1, does not have "Modulus". In other words, the modulus operator can only be applied to two integers, and that's why the error message say "ERROR: operator does not exist: real % integer". I don't know what your "total_grades" is. If it's the total of grade points, then it is not an integer (e.g. A- is 3.7), and you cannot and should not do a modulus. If it's indeed an integer but is declared as real, you can cast it to an integer (see http://www.postgresql.org/docs/8.3/interactive/sql-expressions.html, Section 4.2.8) and make the modulus work. |