Why do you want 2009-10-04 10 to be returned? That day has only one total-value.
For the rest of the rows the following query returns the result you are asking for:
SELECT date, MAX(total) - MIN(total)
FROM tablename
GROUP BY date
Note that DATE is a reserved word in ANSI SQL. It's a good idea to avoid reserved words as column names. (Or do at least double quote them, i.e "...



