删除带有“ - ”的列caractere [英] remove column with "-" caractere

查看:65
本文介绍了删除带有“ - ”的列caractere的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好, 

我在处理我的数据时遇到问题 

please i have a problem while i'am dealing with my data 

所以我有一个包含正数和负数的clumn   例如325,23和-425,12


但是我也有一些只包含这个字符的行" - " 

so i have a clumn that contain positive and negative number   such as 325,23 and -425,12
but i also have some line that contain only this caracter " -" 

我想删除所有这些行(只有" - "CARACTER),因为我想在之后将其转换为浮动 

i want to remove all those line (THAT  having only the "-" CARACTER ) because i want to convert it to float after that 

这里是我的数据示例  

here an example of my data  

任何想法,请通过LEN(CA NET)>使用条件分割。 1但它不起作用 

any idea please i used a conditional split by doing LEN( CA NET ) > 1 but it doesn't work 

推荐答案

使用正确的数据类型列。

Use a correct data type for the column.

您可以使用try_cast函数,无效值将变为空。

You can use try_cast function and the invalid value will become null.

示例:

更新yourtable

update yourtable

设置newCol = Try_cast(yourOldcolumn as decimal(6,2))

Set newCol=Try_cast(yourOldcolumn as decimal(6,2))


这篇关于删除带有“ - ”的列caractere的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆