0

I need to find a way to search all columns along these lines:

select CASE 
            When substr(column,1,7) = 'Report:' then substr(column,8)
            when substr(column,1,5) = 'Print' then substr(column, 6)
        else column
        end
  from table

Any help on syntax and what not would be greatly appreciated!

Vikdor
  • 23,934
  • 10
  • 61
  • 84
eatonphil
  • 13,115
  • 27
  • 76
  • 133

1 Answers1

1

Edit column when selected based on content

Are you looking for this?

UPDATE table
SET 
    column = 
        CASE 
            WHEN substr(column,1,7) = 'Report:' THEN substr(column,8)
            WHEN substr(column,1,5) = 'Print' THEN substr(column, 6)
            ELSE column
        END
WHERE <conditions>
Vikdor
  • 23,934
  • 10
  • 61
  • 84