Если вам нужен оператор выбора:
select concat(
left(description, length(description) - length(substring_index(description, '_', -1))),
substring_index(description, '_', -1) - 1
) description
from tablename
См. демо . Если вы хотите обновить таблицу:
update tablename
set description = concat(
left(description, length(description) - length(substring_index(description, '_', -1))),
substring_index(description, '_', -1) - 1
);
См. Демоверсию .
Результаты:
| description |
| ---------------- |
| Interna_172_16_0 |
| Interna_172_16_1 |
| Interna_172_16_2 |
| Interna_172_16_3 |
| Interna_172_16_4 |
В этом коде предполагается, что все описания заканчиваются числовой строкой.