aggregate function return correct value after a while

join shbcf.ru