Home

Identical expressions should not be used on both sides of a binary operator

Rule description

  • Identical expressions should not be used on both sides of a binary operator

 

Non-compliant Code Example

SELECT
    NAME as nameCol,
    ADDRESS as addressCol,
    CREDIT_LIMIT as creditLimitCol,
	City
FROM
    CUSTOMERS
Where
	CREDIT_LIMIT > 1000 OR CREDIT_LIMIT > 1000 --Non compliant code (Identical expression on both the side of binary operator)

Compliant Code Example

SELECT
    NAME as nameCol,
    ADDRESS as addressCol,
    CREDIT_LIMIT as creditLimitCol,
	City
FROM
    CUSTOMERS
Where
	CREDIT_LIMIT > 1000 OR CREDIT_LIMIT < 2000 --Compliant code
Visual Expert 2020
 VEPLSQLRULE60