?
Solved

to delete a row in SQL

Posted on 2008-06-10
4
Medium Priority
?
197 Views
Last Modified: 2010-04-21
A query returned 2 rows for me. But both the rows are having the same values. I need to delete one row of that. For deleting i tried to update one field of one row so that i can delete one..but its giving out an error like ;

Key column information is insufficient or incorrect. Too many rows were affected by update.

So how can i delete one row of those two
0
Comment
Question by:cinibia_nidhin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1500 total points
ID: 21750717
you could do this:
SET ROWCOUNT 1
DELETE yourtable WHERE col1 = value1 AND col2=value2 ...

Open in new window

0
 
LVL 60

Expert Comment

by:chapmandew
ID: 21750744
delete top(1) yourtable
where yourquerycriteria = 'something'
0
 
LVL 4

Expert Comment

by:albuitra
ID: 21750845
in oracle you can do something like this
delete from TABLE
where CONDITIONS
AND rownum < 2
0
 

Author Closing Comment

by:cinibia_nidhin
ID: 31465712
thanks
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

752 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