当前位置: 代码迷 >> Sql Server >> conn.execute 关于update的一个有关问题
  详细解决方案

conn.execute 关于update的一个有关问题

热度:77   发布时间:2016-04-27 11:43:03.0
conn.execute 关于update的一个问题。
dim str
str=request.form("uname")
conn.execute "update table set user='"&str&"' where id=1"
改变字段user的内容,如果user为空的话,直接赋值,如果user不为空的话,用,隔开后添加新值,譬如:值1,值2

请教带判断的这个sql语句怎么写呢?
请教。

------解决方案--------------------
用 case when
  相关解决方案