Oracle view to Get one field value based on two field values

I need to create an Oracle view on table DocumentNo   ( Fields DocumentNo, StateNo, FullPath)
The StateNo on the view should return with following logic
If FullPath like '%Secure%' return StateNo as 1000
 elseif (StateNo = 10 or StateNo= 5)  return StateNo as StateNo*10
 
else return stateNo
end if
Sam OZAsked:
Who is Participating?
 
sdstuberCommented:
CREATE OR REPLACE VIEW your_view
AS
    SELECT documentno,
           CASE WHEN fullpath LIKE '%Secure%' THEN 1000
                WHEN stateno IN (5, 10) THEN stateno * 10
                ELSE stateno
           END stateno,
           fullpath
      FROM documentno
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.