Collections:
What Are Logical/Boolean Operations in SQL Server
What Are Logical/Boolean Operations in SQL Server Transact-SQL?
✍: FYIcenter.com
Logical (Boolean) operations are performed on Boolean values with logical operators like 'AND', 'OR', or 'NOT'. Logical operations return Boolean values. SQL Server 2005 supports the following logical operations:
Logical operations are commonly used to combine Boolean values resulted from comparison operations. The following tutorial exercise shows you a good example:
DECLARE @income MONEY; DECLARE @marriage_status VARCHAR(10); SET @income = 55000.00; SET @marriage_status = 'Single'; SELECT CASE WHEN (@marriage_status = 'Married' AND @income < 65000) OR (@marriage_status = 'Single' AND @income < 35000) THEN 'Qualified for the benefit.' ELSE 'Not qualified for the benefit.' END; GO Not qualified for the benefit.
⇒ Conditional Statements and Loops in SQL Server in SQL Server Transact-SQL
⇐ IN - Testing Values Returned by a Subquery in SQL Server
⇑ Boolean Values and Logical Operations in SQL Server Transact-SQL
2017-01-11, 2178🔥, 0💬
Popular Posts:
How AdventureWorksLT tables are related in SQL Server? There are 12 user tables defined in Adventure...
Where to find tutorials to answer some frequently asked questions on Microsoft SQL Server Transact-S...
What Is a Parameter File in Oracle? A parameter file is a file that contains a list of initializatio...
How To Use SQL*Plus Built-in Timers in Oracle? If you don't have a stopwatch/timer and want to measu...
What Happens If the UPDATE Subquery Returns Multiple Rows in SQL Server? If a subquery is used in a ...