DIV
From SQLZoo
a DIV b | ||
---|---|---|
Engine | OK | Alternative |
ingres | No | FLOOR(a/b) |
mysql | Yes | |
oracle | No | FLOOR(a/b) |
postgres | No | FLOOR(a/b) |
sqlserver | No | FLOOR(a/b) |
DIV
a DIV b returns the integer value of a divided by b.
8 DIV 3 -> 2
In this example we calculate the population in millions.
SELECT name,
population DIV 1000000
FROM bbc
SELECT name,
FLOOR(population/1000000)
FROM bbc
See also
Language: | English • Deutsch |
---|