G
Guest
H
I'm trying to join a table onto itself so that I can duplicate a specific (but common field) reference to eacg line detail
Sampe Data is as follows
Period Trx Date Reference Amount Description Alloc Re
2003050 7/31/2003 WWH0034696 55.00 ABC Company Inc 12352
2003050 7/31/2003 WWH0034698 59.00 Invoice-General 12352
2003050 8/01/2003 1053 155.00 PAYMENT 12352
Note that the Alloc Ref column data is always the same
The SQL that I'm having trouble with is as follows
SELECT m1.*,m2.Referenc
FROM m1, m
WHERE m1.Alloc Ref = m2.Alloc Re
AND m1.Description="PAYMENT
AND m2.Description="PAYMENT
What should happen is that the data replicates itself next to the columns that are already there. In addition to that, it should extract out the data under Reference if the Description field has "PAYMENT" in it.
Any suggestions or a revised example would be really appreciated as I'm banging my head on it at this point. I suspect part of the issue is that the punctuation may not be correct in some places. Alternatively, if there is an easier way that would be great too
Thank
Davi
I'm trying to join a table onto itself so that I can duplicate a specific (but common field) reference to eacg line detail
Sampe Data is as follows
Period Trx Date Reference Amount Description Alloc Re
2003050 7/31/2003 WWH0034696 55.00 ABC Company Inc 12352
2003050 7/31/2003 WWH0034698 59.00 Invoice-General 12352
2003050 8/01/2003 1053 155.00 PAYMENT 12352
Note that the Alloc Ref column data is always the same
The SQL that I'm having trouble with is as follows
SELECT m1.*,m2.Referenc
FROM m1, m
WHERE m1.Alloc Ref = m2.Alloc Re
AND m1.Description="PAYMENT
AND m2.Description="PAYMENT
What should happen is that the data replicates itself next to the columns that are already there. In addition to that, it should extract out the data under Reference if the Description field has "PAYMENT" in it.
Any suggestions or a revised example would be really appreciated as I'm banging my head on it at this point. I suspect part of the issue is that the punctuation may not be correct in some places. Alternatively, if there is an easier way that would be great too
Thank
Davi