select centrucost, coalesce(sum(nrbonuri),0)
from BONURI...ang
group by centrucost
Acum de ce e gresit ce faceai tu
(select distinct(centrucost) from bonuri...ang) iti intoarce mai mult de 1 valoare - si nu poate fi egal un scalar(centrucost) cu o tabela ...
Ignat Andrei
http://serviciipeweb.ro/iafblog