In WHERE clauses with multiple AND conditions, it is useful to move AND to the beginning of the next line, as documented in Settings / Editor / Code Style / SQL / SQL dialect: 'Place top-level AND/OR To begin'. But doing so also moves a related comment ( -- comment ) to the next line, while the comment in fact refers to the condition preceding the AND. This results in confusing scripts.
WHERE condition_1 -- comment on condition_1 AND
condition_2 -- comment on condition 2 AND
after formatting becomes
AND -- comment on condition 1
-- comment on condition 2 condition_3
The comments should not be moved to the next line, but be kept next to the AND condition that they refer to, as in
WHERE condition_1 -- comment on condition_1
AND condition_2 -- comment on condition 2
This would avoid a lot of corrective editing.