Applies to: SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics Analytics Platform System (PDW) SQL analytics endpoint in Microsoft Fabric Warehouse in Microsoft Fabric SQL database in Microsoft Fabric Preview
Multiplies two expressions (an arithmetic multiplication operator).
Transact-SQL syntax conventions
Syntaxexpression * expression
Arguments
expression
Is any valid expression of any one of the data types of the numeric data type category, except the datetime and smalldatetime data types.
Returns the data type of the argument with the higher precedence. For more information, see Data Type Precedence (Transact-SQL).
ExamplesThe following example retrieves the product identification number, name, the list price and the new list price of all the mountain bicycles in the Product
table. The new list price is calculated by using the *
arithmetic operator to multiply ListPrice
by 1.15
.
-- Uses AdventureWorks
SELECT ProductID, Name, ListPrice, ListPrice * 1.15 AS NewPrice
FROM Production.Product
WHERE Name LIKE 'Mountain-%'
ORDER BY ProductID ASC;
GO
Examples: Azure Synapse Analytics and Analytics Platform System (PDW)
The following example retrieves the first and last name of employees in the dimEmployee
table, and calculates the pay for VacationHours
for each..
-- Uses AdventureWorks
SELECT FirstName, LastName, BaseRate * VacationHours AS VacationPay
FROM DimEmployee
ORDER BY lastName ASC;
See Also
Data Types (Transact-SQL)
Expressions (Transact-SQL)
Built-in Functions (Transact-SQL)
Operators (Transact-SQL)
SELECT (Transact-SQL)
WHERE (Transact-SQL)
*= (Multiplication Assignment) (Transact-SQL)
Compound Operators (Transact-SQL)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4