SQL Query to Find Repeat Customer

Total Post:110

 2012  View(s)
Rate this:

In an [orders] table, some rows have the same value for the Customer column meaning they are repeat customers.

ProductID            Customer

111                         Mr. John

333                         Mr. Rakesh

444                         Mr. John

777                         Mr. Shiva

999                         Mr. Rakesh

What can I do to find the repeat customer instead of product id different? I get the all customer which are repeated on the basis of customer Name.

  1. Post:10

    Re: SQL Query to Find Repeat Customer

    hi jeet,

    You should try to this:
    SELECT Customer FROM yourTable 
    GROUP BY Customer
    HAVING COUNT(*) > 1

      Modified On Apr-05-2018 05:58:46 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.