--- title: "Logical Operators (Transact-SQL)" description: "Logical Operators (Transact-SQL)" author: rwestMSFT ms.author: randolphwest ms.reviewer: "" ms.date: "03/06/2017" ms.prod: sql ms.prod_service: "sql-database" ms.technology: t-sql ms.topic: reference ms.custom: "" helpviewer_keywords: - "operators [Transact-SQL], logical" - "testing truth" - "truth testing" - "TRUE" - "FALSE" - "logical operators [SQL Server], Transact-SQL" dev_langs: - "TSQL" --- # Logical Operators (Transact-SQL) [!INCLUDE [SQL Server Azure SQL Managed Instance](../../includes/applies-to-version/sql-asdbmi.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)