Selecting data from multiple rows into a single row multiple columns
SELECT dm_ID, MAX(Amount1) Amount1, MAX(Amount2) Amount2,...
FROM (
SELECT dm_id,
CASE Value WHEN 1 THEN Value ELSE NULL END AS Amount1,
CASE Value WHEN 2 THEN Value ELSE NULL END AS Amount2,
....
FROM Table
) RearrangedData


Old school pivot. It will work, but you need to know the possible values of Amount column, to use in the CASE statement...  TSQL so should be supported by mySQL.