如何更新空白的列值 [英] How to update column value which is blank

查看:77
本文介绍了如何更新空白的列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



我有一张表,其中2个月的包裹值(双倍)数据有些未保存。所以该列显示为空白。



我想更新这些地方0.00



请告诉我怎么做。

我尝试了以下查询,但它没有影响任何行。



Hi all

I have a table where parcel value (double) for 2 months data some how didn't saved.so the column is displaying blank.

I want to update those places with 0.00

Please tell me how to do this.
I tried below query but it's not effecting any row.

update tbl_transaction_master set parcel='0.00' where parcel = ' '





以下是样本数据





below is sample data

0.00; "5673" ; ; 2
0.00; "2313" ; ;27
0.00; "1254"; ;1635
0.00 ;"4458"; ;1636
0.00; "8796"; ;8
0.00; "3698"; ;9
0.00; "0215"; ;115

推荐答案

基础数据(可能)为NULL而非空白,无论如何您检查它是否等于a double值永远不能包含的空间。您还尝试将字符串值分配给double。



尝试
The underlying data is (probably) NULL not blank, and in any event you are checking for it being equal to a space which a double value can never contain. You are also trying to assign a string value to a double.

Try
update tbl_transaction_master set parcel=0.00 where COALESCE(parcel, 0) = 0







[Edit - corrected the bug where I was comparing strings and numerics)


这篇关于如何更新空白的列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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