当前位置:网站首页>Sqlserver string type converted to decimal or integer type
Sqlserver string type converted to decimal or integer type
2022-06-30 21:21:00 【※※ Bingxin ※※】
stay SQL Server in , There are three ways to convert a string value to a numeric value .
1. Use cast() Method .
select cast('6.0' as decimal(6, 2)); -- 6.00
2. Use convert() Method .
select convert(decimal(6, 2), '100'); -- 100.00
3. Use and value 0 The method of addition .
select '233' + 0; -- 233
The above three methods should pay special attention to the value of the converted type when converting the type , Because there may be various problems of forced conversion failure , For example, the number of decimal places / Error reporting caused by format mismatch .
边栏推荐
- 攻防演练中的防泄露全家福
- oprator-1初识oprator
- CA I ah, several times Oh, ah, a sentence IU home Oh
- Electronic scheme development - Intelligent rope skipping scheme
- 学习总结
- 将el-table原样导出为excel表格
- Apply for vector bus protocol color picture wallpaper hanging picture, very good!
- How to run jenkins build, in multiple servers with ssh-key
- 的撒啊苏丹看老司机
- 科研中遇到迷茫困惑如何向前一步?如何在科研中发挥女性优势?
猜你喜欢

漫谈Clickhouse Join

Qiao NPMS: search for NPM packages

Reading notes of Clickhouse principle analysis and Application Practice (3)

修改已经上线的小程序名称

Adobe Photoshop (PS) - script development - remove file bloated script

Adobe-Photoshop(PS)-脚本开发-去除文件臃肿脚本

Spatiotemporal data mining: an overview

Double solid histogram / double y-axis

文本生成模型退化怎么办?SimCTG 告诉你答案

雷达数据处理技术
随机推荐
Clickhouse Native Monitoring item, System table Description
mysql-批量更新
Auto-created primary key used when not defining a primary key
电子方案开发——智能跳绳方案
Zaah Sultan looks at the old driver
【无标题】
ClickHouse distributed表引擎
《ClickHouse原理解析与应用实践》读书笔记(2)
Oprator-1 first acquaintance with oprator
ArcGIS construction and release of simple road network data service and rest call test
ca i啊几次哦啊句iu家哦11111
Gartner聚焦中国低代码发展 UniPro如何践行“差异化”
docker安装mysql
[原创]用代码dialog 高度 宽度无法屏幕屏幕问题
19.04 distributor
clickhouse原生監控項,系統錶描述
Electronic scheme development - Intelligent rope skipping scheme
Introduction of 3D Max fine model obj model into ArcGIS pro (II) key points supplement
Who are you and I
Coefficient of variation method matlab code [easy to understand]