If I have this data
[pre]
ID Acct Date Amount TranCode ID Acct Date Amount TranCodeType
5 123 7/5/2017 10000 18 76 123 7/5/2017 10000 12
6 123 7/5/2017 10000 18 77 123 7/5/2017 10000 12
7 123 7/5/2017 10000 18 78 123 7/5/2017 10000 12
[/pre]
between two tables (with ID being the first field in each table) and I join the two tables on the data points that I have available, then I end up with 9 items instead of 3 matching records. Given the lack of unique identifiers, how would you get
[pre]
ID ID
5 76
6 77
7 78
[/pre]
instead of
[pre]
ID ID
5 76
5 77
5 78
6 77
6 78
6 76
7 78
7 77
7 76
[/pre]
that I get with
I keep thinking I must be missing something, but I cannot see it. Thanks for your help!
Willie
[pre]
ID Acct Date Amount TranCode ID Acct Date Amount TranCodeType
5 123 7/5/2017 10000 18 76 123 7/5/2017 10000 12
6 123 7/5/2017 10000 18 77 123 7/5/2017 10000 12
7 123 7/5/2017 10000 18 78 123 7/5/2017 10000 12
[/pre]
between two tables (with ID being the first field in each table) and I join the two tables on the data points that I have available, then I end up with 9 items instead of 3 matching records. Given the lack of unique identifiers, how would you get
[pre]
ID ID
5 76
6 77
7 78
[/pre]
instead of
[pre]
ID ID
5 76
5 77
5 78
6 77
6 78
6 76
7 78
7 77
7 76
[/pre]
that I get with
Code:
select table1.Id,table2.Id
from table1
join table2
[indent]on table1.acct = table2.acct[/indent]
[indent]and table1.date = table2.date[/indent]
[indent]and table1.amount = table2.amount[/indent]
I keep thinking I must be missing something, but I cannot see it. Thanks for your help!
Willie