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 4 of 4
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,990
    Thanks
    120
    Thanked 76 Times in 76 Posts

    find 'duplicate'

    The first would be duplicate of second. How to find those ?
    Code:
    Agaric g?ant
    Agaric géant
    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
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,103
    Thanks
    80
    Thanked 4,554 Times in 4,518 Posts
    Make sure you are using the same collation to look at both fields??
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,990
    Thanks
    120
    Thanked 76 Times in 76 Posts
    Nope, that is all in the same field. + there can be more than one ? in string.

    I was testing all kind of encoding on some text, and while some text appeared 'é' there could still be '?' inside text. No way to get them all OK.

    Hence my upper question, since my insert did not violate key-s, but it is duplicate anyway.
    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

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,103
    Thanks
    80
    Thanked 4,554 Times in 4,518 Posts
    So how did the bad data (with the ?) get in there in the first place???

    But anyway, couldn't you use LIKE?

    Example:
    Code:
    SELECT t1.*
    FROM table AS t1, table AS t2
    WHERE t1.field LIKE REPLACE( t2.field, '?', '_' )
    You replace the ? with underline, which is the one-character wildcard used by LIKE and then compare them using LIKE instead of just =
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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