http://www.sql.ru/forum/1266458/zapros-s-gruppirovkoy-po-neskolkim-tablicam-problema-v-pole-s-summoy-summiruet-linee