Collections:
SIGN() - Sign of a Number
How to get the sign of a given number using the SIGN() function?
✍: FYIcenter.com
SIGN(X) is a MySQL built-in function that
rounds the sign of X as -1, 0, or 1.
For example:
SELECT SIGN(-32), SIGN(0), SIGN(234); -- +-----------+---------+-----------+ -- | SIGN(-32) | SIGN(0) | SIGN(234) | -- +-----------+---------+-----------+ -- | -1 | 0 | 1 | -- +-----------+---------+-----------+
Reference information of the SIGN() function:
SIGN(X): int Returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive. Arguments, return value and availability: X: Required. The input value. int: Return value. The integer representing the sign of X. Available since MySQL 4.0.
⇒ SIN() - Sine Trigonometric Value
⇐ ROUND() - Rounding to Decimal Place
2023-11-15, 1756🔥, 0💬
Popular Posts:
How to connect SQL Server Management Studio Express to SQL Server 2005 Express in SQL Server? Once y...
Where to find SQL Server database server tutorials? Here is a collection of tutorials, tips and FAQs...
How to print value on console in SQL Server Transact-SQL? How to use the PRINT statements? In Transa...
How to obtain the number of rows found by the last SELECT statement using the FOUND_ROWS() function?...
What Are Bitwise Operations in SQL Server Transact-SQL? Bitwise operations are binary operations per...