Export (0) Print
Expand All

AND

SQL Server 2000

Combines two Boolean expressions and returns TRUE when both expressions are TRUE. When more than one logical operator is used in a statement, AND operators are evaluated first. You can change the order of evaluation by using parentheses.

Syntax
Boolean_expression AND boolean_expression
Arguments
Boolean_expression
Is any valid expression in Microsoft® SQL Server™ 2000 Windows® CE Edition (SQL Server CE) that returns a Boolean value: TRUE, FALSE, or UNKNOWN.
Result Types

bit

Result Value

Returns TRUE when both expressions are TRUE.

Examples

The following example uses AND to get the total cost of a specific order for a particular product in the Northwind database.

SELECT UnitPrice * Quantity AS "Total Cost" FROM "Order Details" WHERE ProductID = '11' AND OrderID = '10248'

Show:
© 2014 Microsoft