如何比较两个表中的值 [英] How to compare values in two tables

查看:65
本文介绍了如何比较两个表中的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

海...


我有两个表A和B.表A包含22个字段,表B包含与表A相同的字段.在这里,我想比较两个表的行,即检查表B是否包含与表A相同的行.然后,我想将不同的行存储在第三表中.是否有任何Sql查询来执行此操作.在这里,我使用C#.net作为前端,使用sql server 2000作为后端.请帮帮我.

与谢谢
Sujith

Hai...


I have two table A and B.Table A Contain 22 Fields and Table B Contain Same fields as Table A. Here i want to compare two table row wise,i.e Checking whether Table B contain same rows as in Table A.If there is any different rows then,i want to store that row in third Table.Is there any Sql query to do this. Here i am using C#.net as Front end and sql server 2000 as back end. Please help me.

With Thank you
Sujith

推荐答案

使用Union ,如下文所述
http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx [ ^ ]
Use Union as described in article below
http://weblogs.sqlteam.com/jeffs/archive/2004/11/10/2737.aspx[^]


这篇关于如何比较两个表中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆