?
select d.user_id, sum(d.amount_rub) - sum(w.amount_rub) rub, sum(d.amount_btc) - sum(w.amount_btc) btc from deposits d full join withdrawals w on d.user_id = w.user_id where d.amount_rub > 0 and w.amount_rub > 0 and d.amount_btc > 0 and w.amount_btc > 0 group by d.user_id теперь результат просто пустой...
Обсуждают сегодня