Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Blessed1978
Yak Posting Veteran
97 Posts |
Posted - 2014-12-18 : 13:10:17
|
I am joining on a address table that has 6 addresses in a field labeled line 1Along with another column date-addedI would like to get one primary and one secondary address from my joinTo get primary I can easily say select Max date ,line1 from my address tableIf there is only one address on line1 I can make line1 both primary and secondary The problem now is if I have multiple addresses in line1 I would like to chose the next highest date that is not like my primary . How would I accomplish this |
|
gbritton
Master Smack Fu Yak Hacker
2780 Posts |
Posted - 2014-12-18 : 13:20:40
|
Please post some sample input and desired output. |
|
|
|
|
|