troubleshooting Question

Update multiple row in table with existing values

Avatar of SA4
SA4 asked on
Microsoft SQL Server 2005
8 Comments1 Solution267 ViewsLast Modified:
I have a table with SiteID and their displayOrder. I want to reverse the displayOrder of each siteID.

table values:

SiteID          DisplayOrder
-----------    ------------
15000175             1
15000367             2
15000202             3
15000337             4
15000330             5
15000816             6

is there a way to update the displayOrder so the table will be:

SiteID          DisplayOrder
-----------    ------------
15000175             6
15000367             5
15000202             4
15000337             3
15000330             2
15000816             1

Thanks in advance!

Join our community to see this answer!
Unlock 1 Answer and 8 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 1 Answer and 8 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