I am trying to write an if - else statement where the table Machine has PROD and CPU columns. I want to write it such that if PROD = 'Y' then insert the number of cpu in CPU column to another temporary table call #CpuCount, then sum up the number. Can anyone please help me out ? The table is in Sybase. Thanks.