Current i have a varchar2 column with the following data
NPT_Code
NPT00001
NPT00112
NPT03019A
NPT00419
Trying to figure a way to strip all the letters and get the next increment of the highest value.
Digits are always fix to 5. There always 3 letters to the left. and sometimes there is a letter to the right.
I was going to mak a sequence and manually looking for the highest number in that column and just start from there but i was wondering if anyone else knows another solution that uses max or something simliar.
Select Max(NPT_Code) + 1 into l_NPT_CODE FROM TABLE
UPDATE TABLE
SET NPT_CODE = L_NPT_CODE
WHERE ID = XXXX;