Hi,
i have
select id, name, address from emp. in that id value is comming from other source like '00123' value.
i want to remove leading zeros in dynamic sql query. how can i procede.
id data type is varchar(8). once if i remove the leading zeros.
at run time my data like 'AB123', how can i find the value like.
thanks
vijay
DarilPosted Nov 19, 2021, 6:28 AM
zeros
1 1
2 100
3 000100
4 100100
5 00.001
6 01.001
So if you have a table with zeros as shown above .
The LTRIM removes the leading spaces . And the RTRIM removes the trailing space
SO If we execute the below query
We will get the output as:
We can also do this by casting the specific column as float.
Raja TPosted Jul 12, 2016, 12:42 AM
Praveen SreeramPosted Jul 11, 2016, 1:59 PM