SIGN() Function in MySQL Last Updated : 28 Sep, 2020 Comments Improve Suggest changes Like Article Like Report SIGN() function in MySQL is used to return the sign of the given number. It returns 1 if the number is positive, -1 if the number is negative and 0 for zero. Syntax : SIGN(X) Parameter : SIGN() function accepts one parameter as input and will give you the results in values like Positive(+1),Negative(-1) and Zero(0). X -A number whose sign we want to check. Returns - It returns the value of sign of the given number i.e. Positive(+1), Negative(-1) and Zero(0). Example-1 : Applying SIGN() function to Zero. SELECT SIGN(0) AS Sign_Val; Output : Sign_Val 0 Example-2 : Applying SIGN() function to a positive number. SELECT SIGN(12) AS Sign_Val; Output : Sign_Val 1 Example-3 : Applying SIGN() function to a negative number. SELECT SIGN(-2) AS Sign_Val; Sign_Val-1 Example-4 : Applying SIGN() function to a numeric column in a table. Table -Number X+121.80-1.8-14 SELECT X, SIGN(X) AS X_Sign FROM Number; Output : XX_Sign 1211.8100-1.8-1-14-1 Comment More infoAdvertise with us Next Article SIGN() Function in MySQL J jana_sayantan Follow Improve Article Tags : SQL DBMS-SQL mysql Similar Reads RIGHT() Function in MySQL RIGHT() function in MySQL is used to extract a specified number of characters from the right side of a given string. Second argument is used to decide, how many characters it should return. Syntax : RIGHT( str, len ) Parameter : This function accepts two parameter as mentioned above and described be 3 min read TAN() Function in MySQL TAN() function : This function in MySQL is used to return the tangent of a specified number. In any right triangle, the tangent of an angle is the length of the opposite side divided by the length of the adjacent side. Similarly, this can also be defined as tangent of x is the sine of x divided by t 1 min read SUM() Function in MySQL The SUM() function in MySQL is a powerful aggregate function used to calculate the total sum of values in a numeric column. By summing up the values in the specified column, this function helps in generating overall totals and performing calculations that provide meaningful insights from our data. I 4 min read SECOND() Function in MySQL SECOND() function in MySQL is used to return the second portion of a specified time or date-time value. The first parameter in this function will be the date/Date Time. This function returns the seconds from the given date value. The return value (seconds) will be in the range of 0 to 59. In this fu 2 min read TRIM() Function in MySQL TRIM() function in MySQL is used to clean up data. It is also used to remove the unwanted leading and trailing characters in a string. Syntax : TRIM([{BOTH | LEADING | TRAILING} [remstr] FROM] str) Parameter : This method accepts three-parameter as mentioned above and described below : BOTH | LEADIN 2 min read Like