WordPress how do I echo SUM from a column of a MySQL table by user id AND type_operation

If it’s no extricly neccesary perform an operation in a sql statement I would prefere perfom it over an Array of admin_op data, like : op_sum = get_results( Select fund_user FROM table WHERE type_operation = admin_op ); then var = array_sum(op_sum);