CREATE TABLE WithdrawlsTable
     ( id integer
     , machine integer
     , datestamp date
     , withdrawls integer
     );

INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(1, 1, '01-01-2003', 1101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(2, 2, '01-01-2003', 2101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(3, 3, '01-01-2003', 3101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(4, 1, '02-01-2003', 1102);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(5, 2, '02-01-2003', 2102);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(6, 1, '03-01-2003', 1103);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(7, 3, '03-01-2003', 3103);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(8, 2, '04-01-2003', 2104);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(9, 4, '04-01-2003', 4104);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(11, 1, '01-01-2003', 1101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(12, 2, '01-01-2003', 2101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(13, 3, '01-01-2003', 3101);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(14, 1, '02-01-2003', 1102);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(15, 2, '02-01-2003', 2102);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(16, 1, '03-01-2003', 1103);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(17, 3, '03-01-2003', 3103);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(18, 2, '04-01-2003', 2104);
INSERT INTO WithdrawlsTable (id, machine, datestamp, withdrawls) VALUES(19, 4, '04-01-2003', 4104);

SELECT Datestamp
     , Machine
     , SUM(Withdrawls)
  FROM WithdrawlsTable
 GROUP
    BY Machine
     , Datestamp
 ORDER
    BY Datestamp
     , Machine;
