Turiu lentele: +----+---+---+ | id | a | b | +----+---+---+ | 1 | 1 | 7 | +----+---+---+ | 1 | 0 | 2 | +----+---+---+ | 2 | 1 | 5 | +----+---+---+ | 2 | 0 | 2 | +----+---+---+ | 2 | 0 | 1 | +----+---+---+ Reikia gauti reiksme: id, suma suma skaiciuojama taip: jeigu a reiksme 1 tai b su pliusiu, jeigu a reiksme 0 tai b su minusu ir visi susisumuoja