DIV

From SQLZOO
Revision as of 20:49, 21 October 2012 by Peter (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Compatibility
a DIV b
EngineOKAlternative
ingresNoFLOOR(a/b)
mysqlYes
oracleNoFLOOR(a/b)
postgresNoFLOOR(a/b)
sqlserverNoFLOOR(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
Personal tools
Namespaces

Variants
Actions
Reference
Toolbox
Google AdSense