Ok I have a database where i generate a ticket code everytime a users buy an item. With this code they have the oportunity to win a price
To win the price they have to go to a register form, where the code is ask.. thats where the data is really generated. I ask for name, mail address, and other non important stuff
This part is working nice and properly. but i need to create o new function to detect the best buyers. So when they enter the code to participate , i ask for their mail, i have noticed, they actually enters the same mail each time they register a code. So this is the best way i think to select my best clients, and the most interested on promotions also.
So I think the best is to build a query to search into the mail row .. inside users table, and look for coincidences, and then this query can drop me a list of the most "repited" mails in DSC order,
is this posible, can i build a query like this? how?
Ok , thansk for the comments (why the downvote??) anyway
The structure is
ID | name | lastname | mail | phone | zipcode | birth |
And sorry at this moment i just CANT figure out a query thats why i ask. sorry for been a fool ,