Skip to content

Latest commit

 

History

History
85 lines (67 loc) · 3.29 KB

File metadata and controls

85 lines (67 loc) · 3.29 KB
title * (Multiply) (Transact-SQL) | Microsoft Docs
ms.custom
ms.date 03/15/2017
ms.prod sql-non-specified
ms.reviewer
ms.suite
ms.technology
database-engine
ms.tgt_pltfrm
ms.topic language-reference
f1_keywords
*_TSQL
*
dev_langs
TSQL
helpviewer_keywords
* (multiply operator)
multiplication [SQL Server]
multiply operator (*)
ms.assetid 34beb660-db19-46ca-ac90-2218471457bf
caps.latest.revision 43
author BYHAM
ms.author rickbyh
manager jhubbard

* (Multiply) (Transact-SQL)

[!INCLUDEtsql-appliesto-ss2008-all_md]

Multiplies two expressions (an arithmetic multiplication operator).

Topic link icon Transact-SQL Syntax Conventions

Syntax

-- Syntax for SQL Server, Azure SQL Database, Azure SQL Data Warehouse, Parallel Data Warehouse
    
expression * 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.

Result Types

Returns the data type of the argument with the higher precedence. For more information, see Data Type Precedence (Transact-SQL).

Examples

The 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: [!INCLUDEssSDWfull] and [!INCLUDEssPDW]

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)
*= (Multiply EQUALS) (Transact-SQL)
Compound Operators (Transact-SQL)