locating duplicates across multiple columns

    Date: 04/06/07 (MySQL Communtiy)    Keywords: mysql, sql

    i need to merge rows in a table where column1 = column1 or column2 = column2 or column1 = column2. i'd like to review the data before i merge it. i'm having trouble constructing a query that returns what i need to see. if the table looked like this:

    id  name    phone_number    alt_number
    1   bob q.  123-4567
    2   jen q.  999-9999    123-4567
    3   tom         333-3333
    4   jeff    987-0987    334-9130
    5   earl    333-3333    111-1111


    i'd need a query that returns rows 1,2,3,5 and 6. we're running mysql 4.

    Source: http://community.livejournal.com/mysql/112800.html

« MySQL performance/state... || Delete multiple duplicate... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home