bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL SIGN() Function

Example

SELECT SIGN(255.5);

Definition and Usage

The SIGN() function returns the sign of a number.

This function will return one of the following:

  • If number > 0, it returns 1
  • If number = 0, it returns 0
  • If number < 0, it returns -1

Syntax

SIGN(
number
)

Parameter Values

ParameterDescription
numberRequired. The number to return the sign for

Technical Details

Works in:From MySQL 4.0

Previous

MySQL ROUND() Function

Next

MySQL SIN() Function