Home

WHERE clause conditions should not be contradictory

Rule description

  • WHERE clause conditions should not be contradictory

 

Non-compliant Code Example

SELECT Product.ProductID,  
Product.Name,
Color  
FROM Production.Product  
WHERE ListPrice > 50  AND ListPrice = 200;  --Non compliant code (Where clause condition is contradictory)

Compliant Code Example

SELECT Product.ProductID,  
Product.Name,
Color  
FROM Production.Product  
WHERE ListPrice > 50;  --Compliant code (Where clause condition is not contradictory)
Visual Expert 2020
 VETSQLRULE15