如何在sql中的字段当前值中添加一个值? [英] how to add a value to the current value of a field in sql ?

查看:268
本文介绍了如何在sql中的字段当前值中添加一个值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Vb.net中

如何在sql中为字段的当前值添加值?



在下面的示例中

V1相同的参数值取代之前的



cmd.CommandText =更新列表设置V1 = @ V1其中serial =&序列号



我想追加它,没有被替换

解决方案

试试这个 -



 cmd.CommandText =  更新列表集V1 = V1 + @ V1其中serial =&串行


in Vb.net
how to add a value to the current value of a field in sql ?

In the example below
V1 same parameter values ​​replace the previous

cmd.CommandText = "Update List set V1=@V1 Where serial = " & serial

I want to append it, was not replaced

解决方案

Try this way -

cmd.CommandText = "Update List set V1=V1+@V1 Where serial = " & serial


这篇关于如何在sql中的字段当前值中添加一个值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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