--- title: "Logical Operators (Transact-SQL) | Microsoft Docs" ms.custom: "" ms.date: "03/06/2017" ms.prod: "sql-non-specified" ms.reviewer: "" ms.suite: "" ms.technology: - "database-engine" ms.tgt_pltfrm: "" ms.topic: "language-reference" dev_langs: - "TSQL" helpviewer_keywords: - "operators [Transact-SQL], logical" - "testing truth" - "truth testing" - "TRUE" - "FALSE" - "logical operators [SQL Server], Transact-SQL" ms.assetid: edd92f08-76fb-4fd7-a4b6-8520d6a81df1 caps.latest.revision: 26 author: "BYHAM" ms.author: "rickbyh" manager: "jhubbard" --- # Logical Operators (Transact-SQL) [!INCLUDE[tsql-appliesto-ss2012-xxxx-xxxx-xxx_md](../../includes/tsql-appliesto-ss2012-xxxx-xxxx-xxx-md.md)] Logical operators test for the truth of some condition. Logical operators, like comparison operators, return a **Boolean** data type with a value of TRUE, FALSE, or UNKNOWN. |Operator|Meaning| |--------------|-------------| |[ALL](../../t-sql/language-elements/all-transact-sql.md)|TRUE if all of a set of comparisons are TRUE.| |[AND](../../t-sql/language-elements/and-transact-sql.md)|TRUE if both Boolean expressions are TRUE.| |[ANY](../../t-sql/language-elements/any-transact-sql.md)|TRUE if any one of a set of comparisons are TRUE.| |[BETWEEN](../../t-sql/language-elements/between-transact-sql.md)|TRUE if the operand is within a range.| |[EXISTS](../../t-sql/language-elements/exists-transact-sql.md)|TRUE if a subquery contains any rows.| |[IN](../../t-sql/language-elements/in-transact-sql.md)|TRUE if the operand is equal to one of a list of expressions.| |[LIKE](../../t-sql/language-elements/like-transact-sql.md)|TRUE if the operand matches a pattern.| |[NOT](../../t-sql/language-elements/not-transact-sql.md)|Reverses the value of any other Boolean operator.| |[OR](../../t-sql/language-elements/or-transact-sql.md)|TRUE if either Boolean expression is TRUE.| |[SOME](../../t-sql/language-elements/some-any-transact-sql.md)|TRUE if some of a set of comparisons are TRUE.| ## See Also [Operator Precedence (Transact-SQL)](../../t-sql/language-elements/operator-precedence-transact-sql.md)