Subject | Re: this works, but is it the best way? |
---|---|
Author | Dixon Epperson |
Post date | 2005-03-01T16:30:29Z |
As always, Helen, Thanks! But I'm trying to understand. . .
Here is my original query
was I not even querying for different??
And why 3?
Do you mean that the following scenario would not have shown in the
results
invoice=1400; id=1001
invoice=1400; id=1002
but if I had added a third one
invoice=1400; id=1003
then they all would have shown?
I'm really exasperated at myself for not understanding, but I look at
what your saying and I feel like Charlie Brown.
E. D. Epperson Jr.
Here is my original query
> >Here is your assessment. . .
> >SELECT s.SD_GTLINENO, s.SD_INVOICE, s.SD_GTID, s1.SD_GTID FROM
> >SALESDATA s, SALESDATA s1
> >WHERE s.SD_GTID != s1.SD_GTID
> >AND s1.SD_INVOICE=s.SD_INVOICE
> >
> Now, currently your query is going to return duplicated output rows ifDo you mean if there had been 3 or more "different" SD_GTID or
> there are three or more SD_GTID rows associated with the same
> SD_INVOICE.
was I not even querying for different??
And why 3?
Do you mean that the following scenario would not have shown in the
results
invoice=1400; id=1001
invoice=1400; id=1002
but if I had added a third one
invoice=1400; id=1003
then they all would have shown?
I'm really exasperated at myself for not understanding, but I look at
what your saying and I feel like Charlie Brown.
E. D. Epperson Jr.