Difference between revisions of "FLOOR"
From SQLZOO
(Created page with "<table align='right' border='1'> <caption>Compatibility</caption> <tr><th colspan='3'>FLOOR(f)</th></tr> <tr><td align='center'>'''Engine'''</td><td align='center'>'''OK'''</t...") |
|||
| (2 intermediate revisions by one user not shown) | |||
| Line 9: | Line 9: | ||
<tr><td align='left'>sqlserver</td><td>Yes</td><td></td></tr> | <tr><td align='left'>sqlserver</td><td>Yes</td><td></td></tr> | ||
</table> | </table> | ||
| + | |||
<h1>FLOOR</h1> | <h1>FLOOR</h1> | ||
<p>FLOOR(f) returns the integer value of f</p> | <p>FLOOR(f) returns the integer value of f</p> | ||
| Line 28: | Line 29: | ||
<p>See also</p> | <p>See also</p> | ||
<ul> | <ul> | ||
| − | <li>[[ROUND function]]</li> | + | <li>[[ROUND |ROUND function]]</li> |
| − | <li>[[CEIL function]]</li> | + | <li>[[CEIL |CEIL function]]</li> |
<li>[[MOD |MOD function]]</li> | <li>[[MOD |MOD function]]</li> | ||
</ul> | </ul> | ||
| + | |||
| + | {{Languages}} | ||
Latest revision as of 21:00, 21 October 2012
| FLOOR(f) | ||
|---|---|---|
| Engine | OK | Alternative |
| ingres | Yes | |
| mysql | Yes | |
| oracle | Yes | |
| postgres | Yes | |
| sqlserver | Yes | |
FLOOR
FLOOR(f) returns the integer value of f
FLOOR(f) give the integer that is equal to, or just less than f. FLOOR always rounds down.
FLOOR(2.7) -> 2 FLOOR(-2.7) -> -3
In this example we calculate the population in millions.
SELECT name, FLOOR(population/1000000) FROM bbc
See also
| Language: | English • Deutsch |
|---|