#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    15
    Rep Power
    0

    Deleting, Sql, Having


    Hi,
    is there a faster way to do this ?

    PHP Code:
    DELETE FROM     Germany USING     Germany     JOIN (         SELECT             email         FROM             Germany         GROUP BY             email         HAVING             COUNT(*) > 1     ) AS multiple_emails ON Germany.email multiple_emails.email 
    thxs
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    Originally Posted by computeruser13
    is there a faster way to do this ?
    don't know

    what's it trying to do? does it run or is there an error? does it work correctly? how often do you plan to run this?
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    15
    Rep Power
    0
    Its was running over 8 hours- than i stoped the script(i have a many rows...
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,118
    Rep Power
    4274
    Originally Posted by computeruser13
    Its was running over 8 hours- than i stoped the script(i have a many rows...
    my advice is to test this type of script on a small table with test data, so that you can verify that it's working correctly before turning it loose on live data
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo