Difference between revisions of "DIV"

From SQLZOO
Jump to: navigation, search
Line 9: Line 9:
 
<tr><td align='left'>sqlserver</td><td>No</td><td>[[FLOOR |FLOOR(a/b)]]</td></tr>
 
<tr><td align='left'>sqlserver</td><td>No</td><td>[[FLOOR |FLOOR(a/b)]]</td></tr>
 
</table>
 
</table>
 +
 
<h1>DIV</h1>
 
<h1>DIV</h1>
 
<p>aDIVb returns the integer value of a divided by b. </p>
 
<p>aDIVb returns the integer value of a divided by b. </p>
Line 34: Line 35:
 
   <li>[[MOD |MOD function]]</li>
 
   <li>[[MOD |MOD function]]</li>
 
</ul>
 
</ul>
 +
 +
{{Languages}}

Revision as of 21:47, 21 October 2012

Compatibility
a DIV b
EngineOKAlternative
ingresNoFLOOR(a/b)
mysqlYes
oracleNoFLOOR(a/b)
postgresNoFLOOR(a/b)
sqlserverNoFLOOR(a/b)

DIV

aDIVb 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