I'm trying to work out how to calculate how many credit card transactions we ran through Tessitura last year. I was assuming that it was just the count of distinct payment_nos in T_PAYMENT that had a credit card type of pmt_method.
But is there some other catch to it all that I should know about?
Try this
select count(distinct payment_no)
from t_payment y
inner join tr_payment_method m on m.id=y.pmt_method
where act_type in (1,2,3,4)
where pmt_dt between <whenever> and <whenever>