Solved

update only one row from 2 exactly similar rows

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Select question from MySQL 1 20
question about results where i dont have a match 3 36
Need to find substring in SQL 5 40
online  environment for testing sql queries 5 29
What's a UDID? If you're involved in developing, testing, or even reviewing an iOS application that's in beta, then at some point you may need to know the UDID for any iOS devices that you'll be testing on. What's the UDID? It stands for Unique Dev…
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.

679 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