Normalizing in SQL with various character length

时间:2016-08-31 12:27:58

标签: sql

I am trying to normalize a field in SQL.

Example:

HXDF469LDI

HXDF469801LDI

This is missing the preceding zeros before the 469.

It should be HXDF000469LDI or HXDF000469801LDI.

The preceding zeros can vary from 1-5 zeros missing. There should be six numbers after the HXDF but because some also contain an extension of 801, 802 and etc not sure how to do this.

0 个答案:

没有答案