http://www.sql.ru/forum/1261065/v-tablice-pri-vkluchenie-itogi-propadaet-poslednyaya-stroka-novaya-zapis