Export (0) Print
Expand All

/ (Divide)

SQL Server 2000

Divides one number by another (an arithmetic division operator).

Syntax
dividend / divisor
Arguments
dividend
Is the numeric expression to divide. dividend can be any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) of any of the data types of the numeric data type category, except the datetime data type.
divisor
Is the numeric expression to divide the dividend by. divisor can be any valid SQL Server expression of any of the data types of the numeric data type category, except the datetime data type.
Result Types

Returns the data type of the argument with the higher precedence.

Examples

The following example uses the divide arithmetic operator to determine the average total cost for each order of product 51 in the Northwind database. Product 51 has 39 orders.

SELECT (SUM(UnitPrice * Quantity))/39 AS "Avg. Cost per Order" FROM "Order Details" WHERE ProductID = '51'

This is the result set:

Avg. Cost per Order
-------------------
1147.2461

Show:
© 2014 Microsoft