The FLOOR() function in SQL rounds down the specified number. Usage syntax: FLOOR(
).
Usage of FLOOR() function in SQL
FLOOR() function is used to round down, that is, Rounds the specified number down to the nearest integer.
Syntax
<code>FLOOR()</code>
Where:
-
<number></number>
: The number to be rounded.
Usage
The usage of the FLOOR() function is very simple. Just pass the number you want to round as an argument to the function.
Example
The following example shows the usage of the FLOOR() function:
-- 取整数字 12.34 SELECT FLOOR(12.34); -- 返回 12 -- 取整浮点数 10.5 SELECT FLOOR(10.5); -- 返回 10 -- 取整负数 -12.34 SELECT FLOOR(-12.34); -- 返回 -13
Notes
- The FLOOR() function does not round zeros after the decimal point. For example, FLOOR(12.00) returns 12, not 11.
- FLOOR() function only rounds down. To round up, use the CEIL() function.
The above is the detailed content of Usage of floor in sql. For more information, please follow other related articles on the PHP Chinese website!

The article discusses horizontal and vertical data partitioning in SQL, focusing on their impact on performance and scalability. It compares benefits and considerations for choosing between them.

This article addresses deleting rows with foreign key constraints in relational databases. It details methods for handling constraint violations, including cascading deletes, restricting deletes, and setting nulls. The article emphasizes best pract

The article explains how to use SQL aggregate functions (SUM, AVG, COUNT, MIN, MAX) to summarize data, detailing their uses and differences, and how to combine them in queries.Character count: 159

The article discusses security risks of dynamic SQL, focusing on SQL injection, and provides mitigation strategies like using parameterized queries and input validation.

The article discusses SQL transaction isolation levels: READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, and SERIALIZABLE. It examines their impact on data consistency and performance, noting that higher isolation ensures greater consistency but ma

The article discusses the ACID properties (Atomicity, Consistency, Isolation, Durability) in SQL transactions, crucial for maintaining data integrity and reliability.

This article details effective testing strategies for SQL DELETE operations. It emphasizes verifying correct row deletion via pre- and post-deletion data comparisons, row counts, and negative testing. Best practices, including backups, transaction

This article compares SQL's DELETE and TRUNCATE commands. DELETE removes rows individually, allowing conditional removal and transaction rollback. TRUNCATE is faster, removing all rows at once, but lacks rollback capability. Performance and data re


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version
Chinese version, very easy to use

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft
