SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Get my greedy down dotJoon's Avatar
    Join Date
    Apr 2003
    Location
    daejeon, South Korea
    Posts
    2,208
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    checking doubling

    Code:
    data in myTable1
    
    (id) country
    (1) America
    (2) Korea
    (3) France
    (4) German
    (5) China
    (6) German
    (7) Canada
    I have data in myTable1 like the above.

    Record (4) and record(6) has same value "german"

    "German" is doubling values.

    I should remove one of german or modify one of german to another new country.

    So I like to check doubling values.
    I can check doubling value by finding the same country value is existed in another record while a query is turning in server language(in my case ColdFusion).

    But I want to know that there is a database(SQL) way to find doubling values?


    The code below doesn't work correctly, but it will show what I want.

    Code:
    would-be code
    
    select id, country
    from myTable1
    where any doubling values
    order by id
    
    target result
    
    (4) German
    (6) German

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,015
    Mentioned
    53 Post(s)
    Tagged
    2 Thread(s)
    that's two threads in the same day on the same problem

    2009 is off to a great start

    see http://www.sitepoint.com/forums/showthread.php?t=591948
    r937.com | rudy.ca | Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"


Bookmarks

Posting Permissions

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