Professional Web Applications Themes

Searchin for multiple similar entries. - MySQL

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...

  1. #1

    Default Searchin for multiple similar entries.

    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 Guest

  2. #2

    Default Re: Searchin for multiple similar entries.

    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
    _|
    [url]http://datacharmer.blogspot.com/[/url]
    Giuseppe Maxia Guest

  3. #3

    Default Re: Searchin for multiple similar entries.

    or you could try something like this:

    SELECT count(*),f_name,GROUP_CONCAT(f_name,' ',l_name) FROM contacts
    WHERE f_name RLIKE '[b,r]ob' GROUP BY f_name;

    strawberry Guest

Similar Threads

  1. AutoComplete with multiple entries
    By StuartW4 in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: April 28th, 06:35 PM
  2. Record Insertion Form causes multiple entries
    By BarryCrandall in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 15th, 10:41 PM
  3. Multiple Sub Table Entries
    By sbowker in forum Dreamweaver AppDev
    Replies: 0
    Last Post: February 27th, 10:21 PM
  4. counting similar entries in a DB
    By Alistair in forum ASP Database
    Replies: 4
    Last Post: October 20th, 07:50 PM
  5. Filemaker mobile, list/menu and multiple entries...
    By neon_bikini in forum FileMaker
    Replies: 0
    Last Post: September 14th, 08:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139