久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

轉換為有效的十進制數據類型

Convert to valid decimal data type(轉換為有效的十進制數據類型)
本文介紹了轉換為有效的十進制數據類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一列 [Cash] nvarchar(50) 包含稍后將在導入過程中轉換為 decimal(9,3) 的數據,其中一些數據與看起來正常的數值一致,例如 134.630,-80.662324.372. 有時我的數據帶有多個點,例如 1.324.372 和 -2.134.630. 有沒有辦法去掉這個多余的點.

I have a column [Cash] nvarchar(50) that has data that will later be converted to decimal(9,3) during an import process,some of the data is consistent with normal looking numeric values such as 134.630,-80.662 and 324.372. Occasionally I have data with multiple dots for the numeric values such as 1.324.372 and -2.134.630. Is there a way of removing this extra dot.

推薦答案

declare @yourtable table(cash varchar(20))
insert @yourtable values('1.324.372')
insert @yourtable values('-2.134.630')
insert @yourtable values('1.234.567.89')

舊代碼:

select reverse(replace(replace(stuff(reverse(cash), charindex(
    '.', reverse(cash)), 1, ','), '.', ''), ',', '.')) 
from @yourtable

稍微升級的代碼(結果是一樣的):

Slightly upgraded code(result is the same):

select reverse(stuff(reverse(replace(cash, '.', '')), 
    charindex('.', reverse(cash)), 1, '.'))
from @yourtable

結果:

1324.372
-2134.630
1234567.89

這篇關于轉換為有效的十進制數據類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Converting Every Child Tags in to a Single Column with multiple Delimiters -SQL Server (3)(將每個子標記轉換為具有多個分隔符的單列-SQL Server (3))
How can I create a view from more than one table?(如何從多個表創建視圖?)
Create calculated value based on calculated value inside previous row(根據前一行內的計算值創建計算值)
How do I stack the first two columns of a table into a single column, but also pair third column with the first column only?(如何將表格的前兩列堆疊成一列,但也僅將第三列與第一列配對?) - IT屋-程序員軟件開發技
Recursive t-sql query(遞歸 t-sql 查詢)
Convert Month Name to Date / Month Number (Combinations of Questions amp; Answers)(將月份名稱轉換為日期/月份編號(問題和答案的組合))
主站蜘蛛池模板: 国产精品国产成人国产三级 | 国产特级毛片aaaaaa | 国产精品久久久久久久久免费高清 | 久久天堂网 | 中文字幕亚洲无线 | 在线观看av网站 | 在线观看av中文字幕 | 97色在线视频 | 欧美一区2区三区4区公司 | 免费日韩av网站 | 色姑娘综合网 | 三级黄色大片网站 | 日本不卡一区二区三区 | 日本一卡精品视频免费 | 久久久不卡网国产精品一区 | 成人精品一区二区三区四区 | 欧美日韩综合一区 | 在线观看亚洲专区 | 久久精品国产一区二区 | 黑人中文字幕一区二区三区 | 成人性视频在线 | 看亚洲a级一级毛片 | 99精品电影 | 国产精品久久久久久久久久久久冷 | 国产精品一区二区精品 | 亚洲精品视频在线看 | 亚洲综合在线视频 | 99色在线| 欧美多人在线 | 午夜网| 日韩在线视频精品 | 精品一区二区三区四区在线 | 午夜精品久久久久久久久久久久 | 国产精品日韩欧美一区二区三区 | 免费在线a视频 | 日韩精品一区二区三区中文在线 | 欧美在线视频一区二区 | 精品中文字幕在线观看 | 一区二区在线 | 91精品国产91 | 九九热在线免费观看 |