Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 sql scrip

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2005-08-24 : 07:48:16
nizam writes "hi........
is there any scrip that i can use to delete same data field in selected column only.
how can i done that?"

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2005-08-24 : 07:52:43
Can you give an example?
Post some sample data and the result you want

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

nadejda18
Starting Member

7 Posts

Posted - 2005-08-24 : 18:19:28
You can try this:

delete from your_table
where your_column in
(select your_column
from your_table
group by (your_column) having count(your_column) > 1)

If your_column can be NULL, you have to use ISNULL(your_column, "depends on the type of your_column") instead of just your_column.
Go to Top of Page
   

- Advertisement -