Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,992
    Thanks
    120
    Thanked 76 Times in 76 Posts

    On duplicate key delete

    I cant't find anything on net about that. Surprised that MySQL does not have that build in.

    possible usage:

    not normalized db, in which case we would not need ON DUPLICATE KEY DELETE:

    Code:
    id    val
    1     on
    2     of 
    3     null 
    4     on
    ....
    normalized db

    master:
    Code:
    id 
    1 
    2
    3
    4
    ....

    detail:
    Code:
    id 
    1 
    3
    ....
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,609
    Thanks
    24
    Thanked 647 Times in 646 Posts
    You are correct there is no delete on duplicate in mtsql.

    But here's a simple and fast way of doing it:
    http://www.justin-cook.com/wp/2006/1...atabase-table/


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •