tenta isso select max(b.kmret) - min(a.kmsai) from tabela a, tabela b where a.data >= '01.09.2011' and b.data <= '21.09.2011' > Samuel