Solved

update only one row from 2 exactly similar rows

Posted on 2012-04-10
2
363 Views
Last Modified: 2012-04-12
there are 2 rows, with no PK.. both are exactly same.. I need to make one different with an update.. but whatever condition i give it is going to update both.. how can i update just one through tsql code?
0
Comment
Question by:25112
  • 2
2 Comments
 
LVL 11

Expert Comment

by:f_o_o_k_y
ID: 37830042
UPDATE TOP 1 table_name
SET col=val
WHERE <condition>
0
 
LVL 11

Accepted Solution

by:
f_o_o_k_y earned 500 total points
ID: 37830072
More complex example:


result:


Best Regards
Fooky
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now