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
    May 2004
    Posts
    1,441
    Thanks
    15
    Thanked 0 Times in 0 Posts

    show all double records

    I have a table in a db

    I want to do a query to either
    1. pull out all unique names

    2 and preferable -- show me which names are in the table more then once.

    can someone help me??

  • #2
    Regular Coder
    Join Date
    Jun 2005
    Posts
    804
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This should work:

    Code:
    SELECT
     name
    ,COUNT(name) AS namecount
    FROM
     table
    GROUP BY
     name
    HAVING
     namecount > 1


  •  

    Posting Permissions

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