How to use below sql query(sum+group by) in ax?

how to use below sql query(sum+group by) in ax?

select sum(CURRENCYAMOUNT), CUSTACCOUNT from ARCSENDSMSCUSTOMERTMP group by CUSTACCOUNT

If you use a select statement in X++, code will be almost identical.
If you want to use Query* classes, it can be done too.