-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
Description
When a subquery is used within a conditional expression, the indentation for SELECT, FROM, and WHERE statements becomes misaligned.
Example:
AND e.department_id NOT IN ( SELECT d2.id
FROM departments d2
WHERE d2.name IN /* excludeDepartments */('HR', 'Finance')
/*%if onlyActiveDepartments */
AND d2.is_active = true
/*%end*/ ) AS dProblem
The SELECT, FROM, and WHERE keywords inside the subquery are not aligned consistently. This results in a visually uneven format that reduces readability.
Expected Behavior
The subquery should follow consistent indentation rules, aligning SELECT, FROM, WHERE, and conditional directives properly under the subquery’s opening parenthesis.