Спасибо, вроде разобрался. А почему после первого seleсt когда пишу DISTINCT то ничего не выводит, а когда без него выводит два значения 3, 3
select acc_id from transaction as t1 where EXISTS( SELECT acc_id, whs_id, max(trn_date) as MaxDate from transaction as t2 GROUP by acc_id, whs_id having MaxDate>'2021-02-11' AND whs_id=1 and t1.acc_id = t2.acc_id)
select * from transaction as t1 where EXISTS( SELECT * from transaction as t2 where trn_date >'2021-02-11' AND t2.whs_id=t1.whs_id and t1.acc_id = t2.acc_id)