I want to make a new column based on another column
Use DECODE:

SELECT ID, PROGRAM_ID, DECODE(PROGRAM_ID, 666, 0, 667, 1, PROGRAM_ID)     AS PATTERN
FROM (                
  SELECT ID, PROGRAM_ID
  FROM YOURTABLE
);


Documentation link to DECODE().

Using CASE, alternatively:

SELECT ID, PROGRAM_ID, 
       CASE PROGRAM_ID WHEN 666 THEN 0
                       WHEN 667 THEN 1
                       ELSE PROGRAM_ID
       END AS PATTERN
FROM (                
  SELECT ID, PROGRAM_ID
  FROM YOURTABLE
);


Example SQL Fiddle here.