Is there a way to alias columns for reference in subqueries?
You need a table alias for both occurrences of the table and then prefix every column with the corresponding table alias to make the column references unambiguous.

select t1.*
from the_table t1
where exists (select *
              from the_table t2
              where t2.a = 7 
                and t2.b = t1.b + 1);


Note that you probably want something like and t2.primary_key &lt;&gt; t1.primary_key in the sub-select as well.