SIGN functions in SQL Server
This article will show you in detail how to use SIGN () function to handle SQL Server with syntax and specific examples to make it easier to visualize and capture functions.
Describe
The SIGN function in SQL Server is used to retrieve the sign of a number or the transmitted expression.
The function will return one of the following:
- If number> 0, SIGN returns 1
- If number = 0, SIGN returns 0
- If number <0, SIGN returns -1
Syntax
To use the SIGN function in SQL Server, we use the following syntax:
SIGN(number)
Parameters :
- number: number passed to get the mark
Note :
- SIGN function can be used in later versions of SQL Server: SQL Server 2017, SQL Server 2016, SQL Server 2014, SQL Server 2012, SQL Server 2008 R2, SQL Server 2008, and SQL Server 2005.
For example
See and explore some examples of SIGN functions in SQL Server.
SELECT SIGN(-23);
Result: -1
SELECT SIGN(-0.1);
Result: -1
SELECT SIGN(0);
Result: 0
SELECT SIGN(0.1);
Result: 1
SELECT SIGN(14);
Result: 1
SELECT SIGN(2019-2014);
Result: 1
Previous article: ROUND function in SQL Server
Next article: SUM function in SQL Server
4 ★ | 1 Vote
You should read it
May be interested
- Apple officially locked iOS 11.3 signtoday apple has been the key to sign ios 11.3, after a week of launching ios 11.3.1. this means that users cannot undo the old operating system version after they have uploaded to ios 11.3.
- The difference between web server and app serveryou have probably seen that the terms web server and app server are often used interchangeably as if they are related to the same thing and also facilitate the website to function properly. but in reality, they are not the same.
- How to Sign Out of Windows 10do you want to sign out of windows 10, but can't seem to find the option to do so? signing out of windows does not shut down your computer and lets you sign in to another user account. scroll down to the first step to get started. *before...
- ABS function in SQL Serverthis article will show you in detail how to use the abs () handling function in sql server with specific syntax and examples to better visualize and capture functions.
- Using the 'Sign In With Google' option is risky and there is currently no workaroundresearchers have found that using this feature as an employee of a business can put you at risk of having your privacy violated, and worse, there's no fix yet.
- Summary of trigonometric functions in Excelradians trigonometric functions, degrees, cos, ... in excel will help users to calculate quickly, compared to manual methods.
- How to insert a signature into PDF on Macyou can create signatures and use it to sign very simple documents on a mac. no need to download new applications, no need for online services.
- Network basics: Part 3 - DNS Servera dns server is a server that contains a database of public ip addresses and hostnames associated with them. in most cases, the dns server is used to resolve or translate those common names into ip addresses as required.
- How to fix 'We can't sign into your account' error on Windows 10some windows 10 insider build 20226 users have reported that they were unable to log in to user profile (s) as expected. microsoft now offers a solution for help with this problem.
- FLOOR function in SQL Serverthe floor function in sql server returns the largest integer value but less than or equal to the transmitted numeric expression.