SQL Query to Find Repeat Customer

Total Post:110

Points:776
 1754  View(s)
Ratings:
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

    Points:70
    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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!