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
1 Answer 1
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
lang-sql