1 ) + will be used for Addition
2) - will be used for Subtraction
3) * will be used for Multiplication
4) / will be used for Division
5) % will be used for Modulo ( Returns the integer remainder of a division)
Let's write our query to perform these operations
Select 2+3 as Addition, 5-2 as Subtraction, 5*6 as Multiplication, 40/5 as Division, 6/4 as IntDivision, 6/4.0 as NumericDivision, 7%2 as Modulos
|How to perform Arithmetic Operations in SQL Server - SQL Server / TSQL Tutorial|
I used static values for arithmetic operations. you can multiple columns, make sure they are numeric data types.
Addition ( + ) can also be used to concatenate the string in TSQL.
Select 'Aamir ' + 'Shahzad' as MyName
|How to use Addition Sign to perform Concatenation in SQL Server - SQL Server / TSQL Tutorial|
Let's say that if I would like to add or subtract few days from Current date, I can use below query.
Select GETDATE()+5 AS Add5eDaystoCurrentDate, GETDATE()-30 AS Subtract30DaysfromCurrentDate