This is a discussion on Searchin for multiple similar entries. within the MySQL Database forums, part of the Database Forums category; Hi, I am looking for double entry in my database. So that, for example, if the name bob was listed ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi,
I am looking for double entry in my database. So that, for example, if the name bob was listed more than once I would get the name and the number of times it is listed. What select statement should I use to list all the similar entries? Regards, Simon |
|
|||
|
Simon wrote:
> Hi, > > I am looking for double entry in my database. > So that, for example, if the name bob was listed more than once I would get > the name and the number of times it is listed. > > What select statement should I use to list all the similar entries? > > Regards, > > Simon > > Here's one way to get all duplicates from the "name" column: SELECT name, count(*) as how_many FROM tablename GROUP BY name HAVING how_many > 1 ciao gmax -- _ _ _ _ (_|| | |(_|>< The Data Charmer _| http://datacharmer.blogspot.com/ |