Karam

If your installed MySQL version supports sub-query, try this:

Delete your_table t
where (t.email, t.version) not in
  ( select s.email, min(s.version)
    from your_table s
    group by s.email 
   )

Hope this helps.
________________________
Lin 

-----Original Message-----
From: Karam Chand [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 28, 2003 11:27 AM
To: Jeff McKeon; [EMAIL PROTECTED]
Subject: RE: Deleting duplicating records

Well that is OK if I have only one email.

What if if I have thousands of users duplicated...

Do I need to write SQL query 1000 times....

Karam
--- Jeff McKeon <[EMAIL PROTECTED]> wrote:
> How bout....
> 
> Delete from tablename where email like
> [EMAIL PROTECTED] && ID <> 1
> 
> Jeff
> > -----Original Message-----
> > From: Karam Chand [mailto:[EMAIL PROTECTED]
> 
> > Sent: Monday, July 28, 2003 10:33 AM
> > To: [EMAIL PROTECTED]
> > Subject: Deleting duplicating records
> > 
> > 
> > Greetings
> > 
> > I manage a website wherein i keep track of the
> people
> > email who have downloaded my software and the
> version
> > number.
> > 
> > the structure is like -
> > 
> > id int auto_increment primary key,
> > email char,
> > version 
> > 
> > now the same person can download different version
> > therfore my table has data like this -
> > 
> > 1,[EMAIL PROTECTED],1.0
> > 2,[EMAIL PROTECTED],2.0
> > 3,[EMAIL PROTECTED],3.0
> > 
> > Now I want to delete all the records wherein all
> rows
> > with duplicate email addresses are deleted so that
> i
> > have data like
> > 
> > 1,[EMAIL PROTECTED],1.0
> > ...
> > 
> > What should be the query? Thanks in advance.
> > 
> > Karam
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site
> design 
> > software http://sitebuilder.yahoo.com
> > 
> > -- 
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:    
> > http://lists.mysql.com/mysql?>
> [EMAIL PROTECTED]
> > 
> > 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:   
>
http://lists.mysql.com/[EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to