December 20, 2006 at 11:48 am
Hi there,
Por exemplo, I have this table:
col1 col2 col3
1 1 'row1-1'
1 1 'row2-1'
2 2 'row1-2'
2 2 'row2-2'
I need return this, in a select:
col1 col2 col3
1 1 'row1-1 'row2-1''
2 3 'row1-2 'row2-2''
When the colomns col1 and col2 have the same value, concatenate col3
Thanks a lot
December 20, 2006 at 1:12 pm
How do you get the 3 in this line?
2 3 'row1-2 'row2-2''
-SQLBill
December 20, 2006 at 5:36 pm
That's probably meant to be a 2.
It looks like the poster wants the equivalent of a concatenating aggregate with some form of ordering mixed in.
when dealing with varchars, (@a+@b) (@b+@a)
Time to turn to cursors.
December 21, 2006 at 8:42 am
Dave I,
quote: That's probably meant to be a 2.
You might be correct and that's what I assume the poster meant, but too many times I've provided a solution (and seen it happen to others also) based on my assumption only to find out that the poster really did want what they requested. They just didn't give enough information.
That's why I asked for the clarification.
-SQLBill
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply