select sum(trans_money) as total,device_mac from xjy_ka_consume_log group by device_mac
查询结果集
查询表格
select sum(con.trans_money) as total, ma.project_id, ma.ip,ma.device_id from xjy_ka_consume_log as con inner join xjy_ka_machine as ma on con.device_mac = ma.device_id group by ma.device_id
结果集