RE: Data Comparison

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You can also use EXCEPT, e.g.,

SELECT Col1, Col2... FROM Table1
EXCEPT
SELECT Col1, Col2... FROM Table2;

Then do it in the opposite order, e.g.,

SELECT Col1, Col2... FROM Table2
EXCEPT
SELECT Col1, Col2... FROM Table1;

Vern Rabe

"Mary Phelps" wrote:

I have two tables with identical columns. I would like to write to
query to compare the data betweeen the two tables. When I find any
data mismatching between tables, I would like the query to return that
data.

.



Relevant Pages

  • Re: Q re Subqueries (Join Predicate) in Access
    ... FROM Table1 t1 ... WHERE Col2 =3 ... Note the full stop following the closing square bracket. ... select key from table2 ...
    (microsoft.public.access.queries)
  • Re: simple stored procedure
    ... CREATE TABLE table1 (col1 int) ... INSERT INTO table1 VALUES ... CREATE TABLE table2 ...
    (microsoft.public.inetserver.asp.db)
  • Re: select from (select)
    ... Using temp tables: ... select column1 col1 from table1 into temp a; ... select column2 col2 from table2 into temp b; ...
    (comp.databases.informix)
  • Re: Optimizing SQL - Union
    ... select 'col1' as field, col1 as val from table1 ... select 'col2' as field, ...
    (comp.databases.ms-sqlserver)
  • Re: Q re Subqueries (Join Predicate) in Access
    ... Roger Carlson wrote: ... FROM Table1 t1 ... [SELECT Key, Col1 ... WHERE Col2 =3]. ...
    (microsoft.public.access.queries)