You don't give DDL's, your attempts and the errors you get, but
SELECT
CASE
WHEN (SUBSTR(COLUMNNAME,1,2) <> '60' AND COLUMNNAME2 IN (1,2))
THEN 2
ELSE 1 END
FROM TABLENAME
should work.
Cheers.
Carlos.
↧