thanks johanafm, needed a couple of tweaks on your code, but its now working as expected
SELECT SUBSTRING( id 1, (INSTR( id, '_' ) -1 )) AS prefix, SUM( money )
FROM table
WHERE id LIKE '%\_%'
GROUP BY prefix
couple of notes:
INSTR -1 so to remove the , works with it as previous posted but the ids are ###
escaped underscore in search as its a wild card along with% in mysql.