sql 根据条件插入数据问题

来源:百度知道 编辑:UC知道 时间:2024/05/28 11:16:08
想在一个表中插入数值.比如想在conmany表中插入条件符合registerid=3的字符为shopok=1的数据.到底用什么语句噢..谢谢了
在线等答案..
我的意思是符合registerid=3的字符,然后使该行的shopok字段值为1
不好意思,您的答案还不能让我满意..

你说的好象是更新吧:
sql里这样写:
update company set shopok='1' where registerid='3'
asp里这样写
conn.execute("update company set shopok='"& 1 &"'where registerid='"& 3 &"'")

INSERT conmany shopok SELECT 1 FROM 数据来源 WHERE registerid=3

看你的补充似乎不是插入,而是更新

update conmany set shopok=1 where registerid = 3