比较两个表中的列所需的SQL查询。 [英] SQL query needed for comparing a column from two tables.

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

问题描述





我需要sql查询来比较两个具有客户地址的表中的列。为同一个account_id显示的此地址在两个表中都存在不匹配。这需要在参考另一个包含account_id的列时进行检查。



非常感谢

Hi,

I need sql query for comparing a column from two tables which has address of the customers. This address displayed for the same account_id have a missmatch in both the tables. This will be needed to be checked keeping in reference another column containing account_id .

Many thanks

推荐答案

像这样......

选择
like this...
select
table1.accountid,  tabel2.accountid,  tabel1.address,  tabel2.address
from table1
inner join table2
        On table1.accountid = tabel2.accountid and tabel1.address <> tabel2.address



快乐编码!

:)


Happy Coding!
:)


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

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