SQL SELECT 或 INSERT INTO 查询
我正在使用 SQL Server 2000。我需要从一列 (VALIMIT
) 中获取结果并将它们插入到同一表 (VALIMIT2012
) 的另一列 (VALIMIT2012
) 中。代码>lending_limits)。
我的问题是,我是否需要先执行 SELECT
查询,还是只从 INSERT INTO
查询开始,以及 INSERT 的正确语法是什么INTO
查询。
I'm working with SQL Server 2000. I need to take the results from one column (VALIMIT
) and insert them into another column (VALIMIT2012
) in the same table (lending_limits
).
My question is do I need to do a SELECT
query first, or do I just start with an INSERT INTO
query and what the proper syntax would be for the INSERT INTO
query.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用
UPDATE< /code>
声明:
You can do this with an
UPDATE
statement:两者都不。您不插入列,而是插入行,因此您想要的是
更新
:注意:看起来您每年只有一列,这是糟糕的数据库设计。如果每年有不同的数据,则应将其放入单独的表中,以便将年份作为数据而不是列名称的一部分。
Neither. You don't insert columns, you insert rows, so what you want is an
update
:Note: It looks like you have one column per year, which is bad database design. If you have different data for each year, you should put that in a separate table, so that you get the year as data, not part of the column name.