We help IT Professionals succeed at work.

Update with min id from group

91 Views
Last Modified: 2016-04-05
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
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
CERTIFIED EXPERT
Top Expert 2010
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Larry Bristersr. Developer

Author

Commented:
Thanks folks
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.