Skip to content
Advertisement

SQL remove leading zeros

I am unable to remove the leading zeros from a column. In this case my SQL query is

The result is

I am looking for this result.

Advertisement

Answer

Use the floor() function:

Why are you storing these values as strings in the first place? You should be storing numbers as numbers. And if they are numbers, you should not be using string functions on them.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement