troubleshooting Question

Update with min id from group

Avatar of Larry Brister
Larry BristerFlag for United States of America asked on
Microsoft SQL ServerMicrosoft SQL Server 2005Microsoft SQL Server 2008
3 Comments2 Solutions100 ViewsLast Modified:
I have a table that after select is in proper order.
ID     VendorID   PrimaryID     isRank
11         1000           NULL              1
12         1000          NULL              2
13         1000           NULL              3
14         1003          NULL               1
15         1003           NULL              2

In EACH VendorID "Group" I need to set all of the PrimaryID's = ID of the isRank = 1 in the group

Results would be like this
ID     VendorID   PrimaryID     isRank
11         1000           NULL              1
12         1000          11                     2
13         1000           11                   3
14         1003          NULL               1
15         1003           14                   2
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 2 Answers and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros