select v.nroventa, sum(v.importe)
from ventas v, pagosventas p
where v.nroventa=p.nroventa
and v.codigocliente=41
and v.nroventa not in (select p.nroventa
from pagosventas p, ventas v
where p.nroventa=v.nroventa)
group by v.nroventa
Why is this query wrong?
I'm getting syntax error right now, and VB doesn't highlight specific the part that's wrong when the error is thrown.