select sum(amount) from tablo
where (type in (1,2,3)) or
(type=4 and number in (1,4))