select min(InputDate), Account_no, Product_cd, Agent
from table
group by Account_no

未測試, 你可以TRY下

TOP