将数据从一个表转移到另一表

编程入门 行业动态 更新时间:2024-10-10 00:27:22
本文介绍了将数据从一个表转移到另一表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要将值从一个表转移到另一张表. 在这里,代码正在执行,但是会插入到单独的行中. 请告知如何检查插入特定行的条件. 插入test1(photo),从dbo.test test1中选择内容,其中ID = 1" 在此代码中,包含从特定行中获取值的位置

I need to transfer value from one table to another table. Here, the code is executing but it inserting into separate row.. pls tel how to check the where condition for inserting into particular row. "insert into test1(photo) select content from dbo.test test1 where ID = 1" In this code containing where for getting value from particular row

推荐答案

,您无法使用插入查询覆盖任何现有行. 相反,您可以对其进行更新,也可以在更新连接查询到的帮助下进行. 谢谢, Jitendra Kumar you can not override any existing row with insert query. Insteade you can update the same and you can do it with help of update join query to. Thanks, Jitendra Kumar

解决方案: 使用内部联接进行更新查询 此处的示例查询: Solution: Make a update query with inner join example query here: update dbo.test1 set photo=t.content from dbo.test1 as t1 inner join dbo.test as t on t1.regno='13'

更多推荐

将数据从一个表转移到另一表

本文发布于:2023-07-09 10:06:16,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1085505.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:数据   转移到

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!