Compare table contents 
Author Message
 Compare table contents
Hi All,
I have 2 tables of identical schema (3 varchar cols), let
me call them table A and B. I want to run a select on A
which will return only the rows that also exist in B?

Thanks



Tue, 09 Aug 2005 19:34:47 GMT
 Compare table contents

try this

select a.col1, a.col2, a.col3
from tableA a join tableB b
on a.col1.b.col1 and a.col2.b.col2 and a.col3.b.col3

HTH
Falik


Quote:
> Hi All,
> I have 2 tables of identical schema (3 varchar cols), let
> me call them table A and B. I want to run a select on A
> which will return only the rows that also exist in B?

> Thanks



Tue, 09 Aug 2005 19:55:41 GMT
 Compare table contents
SELECT a.col1, a.col2, a.col3
FROM tableA a
INNER JOIN tableb b
ON a.col1 = b.col1
AND a.col2= b.col2
AND a.col3 = b.col3

--
Jacco Schalkwijk MCDBA, MCSD, MCSE
Database Administrator
Eurostop Ltd.


Quote:
> Hi All,
> I have 2 tables of identical schema (3 varchar cols), let
> me call them table A and B. I want to run a select on A
> which will return only the rows that also exist in B?

> Thanks



Tue, 09 Aug 2005 20:01:48 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Comparing table contents of two tables

2. What are the ways to compare contents of tables

3. Algorithm to Compare Contents of Two Tables

4. Best way to compare contents of two tables?

5. Comparing contents of a table in dev/prod database

6. Compare Contents ?

7. data contents compare tool

8. compare xml diff in content

9. Sql script to copy table and contents to new table

10. copy contents of table to another table in different DB. (Same Server)

11. => Update SQL Table using contents Access Table

12. Updating table contents from a remote .dbf table


 
Powered by phpBB® Forum Software