Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8201565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:51:26+00:00 2026-06-07T06:51:26+00:00

There are ton’s of listings on how to find duplicate rows, and remove them,

  • 0

There are ton’s of listings on how to find duplicate rows, and remove them, or list out the duplicates. In the masses of responses i’ve tried searching through on here those are the only responses i’ve found. I figured I would just put up my question since its been an hour and still no luck.

This is the example data I have

Table Name: Customers
_____________________________
ID   | CompanyName
--------------
1    | Joes
2    | Wendys
3    | Kellys
4    | Ricks
5    | Wendys
6    | Kellys
7    | Kellys

I need to be able to find all the duplicates in this table, then put the results into another table that lists what the company name is, and how many duplicates it found.

For example the above table I should have a new table that says something like

Table Name: CustomerTotals
_______________________________
ID   | CompanyName  |   Totals
-------------------------------
1    | Joes         |    1
2    | Wendys       |    2
3    | Kellys       |    3
4    | Ricks        |    1

—–EDIT Added after 2 responses, ran into another question——

Thanks for the responses! What about the opposite? say i only want to add items to a new table “UniqueCustomers” from the Customers table that doesn’t exist in CustomerTotals table?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T06:51:27+00:00Added an answer on June 7, 2026 at 6:51 am

    Try this :

    INSERT INTO CustomerTotals
    (CompanyName, Totals)
    SELECT CompanyName, COUNT(*)
    FROM Customer
    GROUP BY CompanyName
    

    Use an identity column for the ID field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are a ton of questions regarding this problem but none of them seem
I've seen a ton of old posts out there on how to try to
I know there is a ton of stuff on this already and have tried
There are a ton of PHP frameworks out there (i.e. Zend, Seagull, Symfony, CodeIgniter,
ORIGINAL POST There are a ton of articles out there and a lot more
Good morning. I realize there are a ton of questions out there regarding replace
There's a ton of books on Lego Mindstorms programming out there - not least
There's a ton of questions about this particular exception but I couldn't find any
There's a ton of great Ember examples out there, but they all seem to
There are a ton of tutorials and blogs about recording sound from .NET. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.