如何在sql中更新特定列 [英] How to Update perticular column in sql

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

问题描述


我有Sql表格

SId SType CPrefix CNo CRPrefix CRNo

1 1现金100积分100



这里如何仅更新CRNo或CNo这样的列,其余数据相同。



update tbl_SaleSettings set CashNo = @否其中SaleSType = @SalesType



但下次如何更新CRNo ...





Pease帮帮我

谢谢

Hi i've Sql table with
SId SType CPrefix CNo CRPrefix CRNo
1 1 Cash 100 Credit 100

here How to update only column like CRNo or CNo ,remaining data is same.

update tbl_SaleSettings set CashNo=@No where SaleSType =@SalesType

but in next time how to update CRNo...


Pease Help me
Thanks

推荐答案

语法是



Syntax is

UPDATE TABLE_NAME
SET COLUMN1_NAME = NEW_VALUE1
[,COLUMN2_NAME = NEW_VALUE2]
[WHERE PRIMARY_KEY = ID]




$在你的情况下b $ b它将



in your case it will

UPDATE YOUR_TABLE
CNo = 'XXXXX',
CRNo = 'YYYY'
WHERE SId = 1


更新表集CNo = Number1,CRNo = Number2



此sql中没有条件,因为所有其他列都相同。
update table set CNo=Number1, CRNo=Number2

No need condition in this sql, because all other column is the same.


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

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