AS91
AS91

Reputation: 527

Remove Decimal from Alphanumeric Field

From a Table T, I want to remove the decimal from the varchar field ICD10 (alphanumeric ICD10 codes) while also keeping those codes which do not have a decimal. So basically all codes without a decimal.

Original field

ICD10
-----
F84
F84.0
H93.25
F90.2
E75.02

Desired Output

ICD10
----
F84
F840
H9325
F902
E7502

Attempt

SELECT icd10 FROM T;

for the lack of knowledge of which function to use

Upvotes: 1

Views: 2124

Answers (1)

Jim Horn
Jim Horn

Reputation: 889

Use the REPLACE function to replace all decimal points with an empty string ''.

SELECT REPLACE(icd10, '.', '') as icd10 FROM T

Upvotes: 4

Related Questions