- (Negative) (Entity SQL)

Returns the negative of the value of a numeric expression.

Syntax

- expression  

Arguments

expression
Any valid expression of any one of the numeric data types.

Result Types

The data type of expression.

Remarks

If expression is an unsigned type, the result type will be the signed type that most closely relates to the type of expression. For example, if expression is of type Byte, a value of type Int16 will be returned.

Example

The following Entity SQL query uses the - arithmetic operator to return the negative of the value of a numeric expression. The query is based on the AdventureWorks Sales Model. To compile and run this query, follow these steps:

  1. Follow the procedure in How to: Execute a Query that Returns StructuralType Results.

  2. Pass the following query as an argument to the ExecuteStructuralTypeQuery method:

SELECT VALUE product FROM AdventureWorksEntities.Products 
    AS product where product.ListPrice = -(-@price)

See Also

Entity SQL Reference