>>
>>WHERE (b.namount1 + b.namount2 > 0) or ;
>> (b.namount1 + b.namount2 < 0) or ;
>> (b.namount3 <> 0 and a.ctype$"F8" ) ;
>>
>>
>At least = is optimized :) !(a=b) would work I think. I was trying to avoid OR completely as I always found it to be problematic in SQL.
It is probably a distribution question.
Another possible approach would be to preselect/filter
the join field of a and a concat of key and delete-state
for a.ctype$"F8" into a separate cursor,
index it on the key plus a marker for deleted()...
the best sql probably depends on the data in the table,
which is bad programming style but sometimes the fastest.
regards
thomas