SQL QUERY TO FIND REPEAT CUSTOMER

Jeet Verma

Total Post:110

Points:776
Posted by  Jeet Verma
 1459  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. Anchal Kesharwani

    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

     

Answer

NEWSLETTER

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