>Dear Stefan
>
>I refer to second last line
>
>WHERE LEFT(NVL(T1.code,''),3) = '140' ;
>
>
>I do not want to use actual code reference becuase codes may be differ.
>
>Please help again
You're welcome.
In your first message you wrote
> amount1 is price of Fruit items, strarts with 3201
> amount1 is price of Vegetable items, strarts with 3202
Since all people, fruits and vegetables are in the same table, do you have an particular code content for people, too?
If it is not "code Like '140%'", would
WHERE T1.credit = 0 ;
work for you?
hth
-Stefan