0

I have a column 'StormID' 'Basin' which both hold text based values.

StormID Basin EP012018 NEP EP022018 NEP CP012018 NEP <-- I want this value to change to NCP if the first 2 characters are 'CP' in the StormID column.

Thanks for any suggestions. Regards, Bryan

asked Jul 26, 2018 at 23:03

1 Answer 1

0

You can use left() to get the first n characters of a string.

UPDATE elbat
 SET basin = 'NCP'
 WHERE left(stormid, 2) = 'CP';
answered Jul 27, 2018 at 0:02
1
  • knahT you very much :) Commented Jul 27, 2018 at 1:17

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.