Home

An ORDER BY direction should be specified explicitly

Rule description

  • An ORDER BY direction should be specified explicitly

 

Non-compliant Code Example

SELECT
    NAME,
    ADDRESS,
    CREDIT_LIMIT
FROM
    CUSTOMERS
ORDER BY CREDIT_LIMIT;  --Non compliant code (Order by clause without direction)

Compliant Code Example

SELECT
    NAME,
    ADDRESS,
    CREDIT_LIMIT
FROM
    CUSTOMERS
ORDER BY CREDIT_LIMIT ASC;  --Compliant code (Order by clause with direction)
Visual Expert 2020
 VEPLSQLRULE113