SQL query: strange SUM behaviour

welcome to shbcf.ru