March 13, 2014 at 8:57 am
Hi,
I have issue with ny cross apply.I'm currently using to combine values from 2 fields.
example:
fields A = 1,2,3
fields B = X,Z
using the cross apply give me that results :
1,X
1,Z
2,X
2,Z
3,X
3,Z
But would like to keep only combinations with new components.Example :
1,X
1,Z
2,Null
3,Null,
Thanks for your help
March 13, 2014 at 4:55 pm
rhmohamed (3/13/2014)
Hi,I have issue with ny cross apply.I'm currently using to combine values from 2 fields.
example:
fields A = 1,2,3
fields B = X,Z
using the cross apply give me that results :
1,X
1,Z
2,X
2,Z
3,X
3,Z
But would like to keep only combinations with new components.Example :
1,X
1,Z
2,Null
3,Null,
Thanks for your help
So, when would 2 and 3 EVER have any "new components" that weren't already present in 1?
--Jeff Moden
Change is inevitable... Change for the better is not.
March 14, 2014 at 7:19 am
Hi,
That's totally correct.
was almost there by adding a distinct to my query and adding the PK.but seems not totaly correct.
Best regards
March 14, 2014 at 7:31 am
rhmohamed (3/14/2014)
Hi,That's totally correct.
was almost there by adding a distinct to my query and adding the PK.but seems not totaly correct.
Best regards
What makes 2 and 3 different from 1?
How do you identify "new components"?
There's insufficient information to offer any useful answer.
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply