A user entered a batch of records with the wrong suffix in the record name - FY15-Q2
instead of FY16-Q1
. So, the records are something like:
-LAG-FY15-Q2
-AN-FY15-Q2
-OY-FY15-Q2
-RV-FY15-Q2
etc
when they should be
-LAG-FY16-Q1
-AN-FY16-Q1
etc
There are a fairly limited number of prefixes, so I could always do multiple update statements like SET record name = LAG-FY16-Q1 WHERE record name = LAG-FY15-Q2
.
It strikes me there might be a more elegant way to do this with a single update statement. Something with trim, perhaps? Complicating this is the fact that some of the prefixes are three letters and others are two.