使用trim函數。sql
一、刪除左邊的‘0’函數
select trim(leading '0' from col_name);
二、刪除右邊的‘0’code
select trim(trailing '0' from col_name);
三、刪除先後的‘0’class
select trim(both '0' from col_name);