Collections:
What Is an Expression in SQL Server
What Is an Expression in SQL Server Transact-SQL?
✍: FYIcenter.com
An expression is a combination of identifiers, values, and operators that SQL Server 2005 can evaluate to obtain a numeric value.
A simple expression could be a constant, a function, a column name, a variable, or a subquery without any operators.
Complex expressions can be constructed by joining other expressions with operators.
The following tutorial exercise shows you some expression examples:
DECLARE @site VARCHAR(40); SET @site = 'FYIcenter.com'; SELECT 'Welcome'; -- Expression: constant SELECT @site; -- Expression: variable SELECT GETDATE(); -- Expression: function SELECT 'Welcome to '+@site; -- Expression with an operator GO Welcome FYIcenter.com 2007-05-19 18:42:09.077 Welcome to FYIcenter.com DECLARE @rate NUMERIC(5,2); DECLARE @deposit MONEY; DECLARE @value MONEY; SET @rate = 5.25; SET @deposit = 4000.00; -- Expression with multiple operators. SET @value = @deposit*(1.0+@rate/100)*(1.0+@rate/100); PRINT @value; GO 4431.03
⇒ Rules on Arithmetic Operations in SQL Server
⇐ Numeric Expressions and Functions in SQL Server Transact-SQL
⇑ Numeric Expressions and Functions in SQL Server Transact-SQL
2017-04-01, 1615🔥, 0💬
Popular Posts:
How To Present a Past Time in Hours, Minutes and Seconds in MySQL? If you want show an article was p...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
How To Create a Stored Program Unit in Oracle? If you want to create a stored program unit, you can ...
Where to find Oracle database server tutorials? Here is a collection of tutorials, tips and FAQs for...
Where to find answers to frequently asked questions on Conditional Statements and Loops in SQL Serve...