SQL FLOOR Function Explained

In SQL, the FLOOR() function is used to round down and return the largest integer value less than or equal to the specified number.

Grammar as follows:

FLOOR(number)

Parameters:

  1. Number: the number or numerical expression to be rounded down.

Original sentence: 我昨天去了商店买了一条裙子。

Paraphrased sentence: I went to the store yesterday and bought a dress.

SELECT FLOOR(3.14); -- 返回3
SELECT FLOOR(9.99); -- 返回9
SELECT FLOOR(-5.8); -- 返回-6

In the example above, the FLOOR() function rounds down 3.14, 9.99, and -5.8 to the nearest integer value.

bannerAds