Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    4

    Unanswered: Help with duplicate contacts in Contact table

    I'm new to SQL with 2 weeks under my belt....lol, so this may be a simple edit:

    When I run the following query, I can get a list of all dups in the contact field:
    ++++++++++++++++++++++++++++++++++
    SELECT full_name,
    COUNT(full_name) AS NumOccurrences
    FROM contact
    GROUP BY full_name
    HAVING ( COUNT(full_name) > 1 )
    ++++++++++++++++++++++++++++++++++
    However:
    I need to make sure I am de-activating (active = 0) only the contacts where they are listed more then once within the same company table (company.company_id) and the condition is that phone is NULL. I can't seem to make it work. Does anyone have any suggestions for an UPDATE I can use?
    Last edited by Turbert; 09-23-05 at 13:33.

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    What if both Phones a null or both are bot null...

    What do you do then?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Sep 2005
    Location
    Connecticut
    Posts
    4
    If both phone numbers are not null or both are null, then I suppose I would need to figure out a date <> for the Rn_edit, but not totally sure yet

Posting Permissions

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