如何找到一个具有负值而另一个具有相同正值的记录。我已经尝试过这个和类似的东西,但它们不起作用。
where [Check_Number]=[Check_Number] and Payment_Amount = ([payment_amount]/-1)
这个怎么样:
where a.check_Number + b.check_number = 0 and a.check_number < 0
或者,这两个字段是 payment_amount 和 check_number 吗?
where payment_amount = - check_number and check_number < 0
也许是这样的?
select r1.check_number, r1.payment_amount, r2.check_number, r2.payment_amount
from records r1 join
records r2
on r1.check_number = r2.check_number and
r1.payment_amount = - r2.payment_amount