spiff2002
IS-IT--Management
- Jan 31, 2003
- 40
We got some data in two excel files that were imported into two diferent tables (t1 and t2). The tables have a lot of fields in common but they have no primary key nor unique ide. The tables basically contain sales data. I need to run a query where I compare the two tables and get the rows that are not common to the tables. There are pretty good chances that within the same table there are not repeated records
i.e
t1
cust# date qty sale_price item# brand
1 5-5-03 2 10.00 1 b1
2 5-7-03 5 20.00 1 b1
1 5-8-03 10 100.00 2 b2
1 5-6-03 8 80.00 3 b3
t2
cust# date qty sale_price item# brand
1 5-5-03 2 10.00 1 b1
2 5-7-03 5 20.00 1 b1
1 5-6-03 8 80.00 3 b3
The query will show the rows that are in table t1 but not in t2
so the output will be:
cust# date qty sale_price item# brand
1 5-8-03 10 100.00 2 b2
Thanks in advance for any help with this
i.e
t1
cust# date qty sale_price item# brand
1 5-5-03 2 10.00 1 b1
2 5-7-03 5 20.00 1 b1
1 5-8-03 10 100.00 2 b2
1 5-6-03 8 80.00 3 b3
t2
cust# date qty sale_price item# brand
1 5-5-03 2 10.00 1 b1
2 5-7-03 5 20.00 1 b1
1 5-6-03 8 80.00 3 b3
The query will show the rows that are in table t1 but not in t2
so the output will be:
cust# date qty sale_price item# brand
1 5-8-03 10 100.00 2 b2
Thanks in advance for any help with this