1

I want to replace all values from a column, like for example, to replace all values from lane column to 'All lanes' value. I tried to use REPLACE function : REPLACE(lane, '%', 'All lanes') but it does not work that way though. Any thoughts? Thanks in advance!

lane
WA-OR
TX-NY
MA-NJ

Expected output:

lane
All lanes
All lanes
All lanes

1 Answer 1

2

Just use update:

update t
    set lane = 'All lanes';

Note this permanently affects all rows. If you just want the result in a query:

select 'All lanes' as lane
from t;
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! Are there any ways that we could use REPLACE in this case?
REPLACE() would not be appropriate for what you want to accomplish.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.