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
 General SQL Server Forums
 New to SQL Server Programming
 SQL : DELETE query

Author  Topic 

sql_learner2178
Starting Member

1 Post

Posted - 2009-07-22 : 03:21:00
I would like to run DELETE query on a database where we have some rules to DELETE the duplicate data.

The Database is look like below format:

ID FirstName LastName E-mailId Gender Age Marital Status
1 a@a.com
2 a@a.com
3 a a@a.com male
4 a aa a@a.com male 23 single
5 a aa a@a.com male 22 single
6 b bb b@b.com female 30 married
7 b b@b.com female married
8 b bb b@b.com female married
9 b@b.com
10 b@b.com

Rules are given below:

1. Email id duplicate

a) One with no information filled
b) Other with no information filled

-Delete any one


2. Email id duplicate

a) One has information filled
b) Other has no information filled

-Delete (b)


3. Email id duplicate

a) One has information filled
b) Other has same information filled but has more information filled

-Delete (a)


no

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2009-07-22 : 03:25:26
are you using SQL 2000 or 2005/2008 ?


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page
   

- Advertisement -