Problem
I lately ran into problems that a select returned an unexpected negative results und certain condions, e.g. I expected 1 but it returned -1.
select --
1
from dual;
Reason
It turns out that this is a behaviour seen only in clients using SQLPlus or the same libraries as SQLPlus or something of the sort. From https://docs.oracle.com/en/database/oracle/oracle-database/19/sqpug/REMARK.html
A "–" at the end of a REMARK line is treated as a line continuation character.
--
select 1
from --
dual;
Solution
Do not use empty line comments. Place at least one none whitespace character behind the --.