SQL表-复制不同数据类型表的数据
我正在研究场景,我有两个表: “Master_product”和“New_Products”
Master_product 表有 14 个字段 和 New_Products 表有 16 个字段,两个表之间的某些字段相同,但数据类型与 Master_product 不同,
现在我想将记录复制到 Master_product 新产品, 我尝试了更新语法,但它给出了有关数据类型的错误。由于数据类型不同而无法处理。
有没有办法更新Master_product
I am working on scenario, i have two tables:
"Master_product" and "New_Products"
Master_product table have 14 fields
and
New_Products table have 16 fields, some fields are same between both table but different data-types than Master_product
now i want to copy record to Master_product from New_Products,
i tried update syntax but it is giving error regarding data-types. That it can't be processed due to different data types.
is there is any way to update Master_product
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在这种情况下,有两个运算符(强制转换和转换)可能会为您提供帮助。
There are two operators, cast and convert, that might help you in this situation.
如果您可以使用 转换或投射,那么你也许可以这样做:
If you can convert from the 2 types using convert or cast, then you might be able to do it: