Solved

update only one row from 2 exactly similar rows

Posted on 2012-04-10
2
364 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Thanks to luck and dedication (hitting refresh every 5 seconds when the pre-orders were going live at midnight on April 10th) I managed to actually receive an Apple Watch on release day, April 24th. Which means I’ve been using it daily for just ov…
Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

863 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

22 Experts available now in Live!

Get 1:1 Help Now