I need to enter primary key values in MySql database something like the following.
B001_V_WB_001
B002_V_WB_002
B003_V_WB_003
B004_V_WB_004
B005_V_WB_005
....
....
B011_V_WB_010
B010_V_WB_011
...
...
B100_V_WB_100
B101_V_WB_101
...
...
B1000_V_WB_1000
B1001_V_WB_1001
and alike. I need to span through all the rows of this column and extract from the right to the very first occurrence of an underscore - and find the maximum from all the rows in this column.
Is there a best way to do so in MySql?
1 Answer