$ 0 0 You can also use windowed aggregate functions, like Rank() Over (Partition Acct_num, Acct_type)