"find duplicates" sql query

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Re: "find duplicates" sql query

    Access from Office 2000

    "Hans" <hansb@sorry.nospam.com> wrote in message
    news:eer8XdbMEHA.628@TK2MSFTNGP11.phx.gbl...
    > Hi!
    >
    > I don't know which database you are using but something like this might
    work
    > (there may be some typos of course)
    >
    > Select formtype, entrydate, ipaddress from formdate group by formtype,
    > entrydate, ipaddress having count(*) >1 order by ipaddress
    >
    > Regards
    > /Hans
    >
    >

    David Guest

  2. Similar Questions and Discussions

    1. ColdFusion+cfquery+Oracle+CLOB+"Query of Query"
      Error message is: Query Of Queries runtime error. Unsupported SQL type "java.sql.Types.CLOB". My database table: RESMIGAZETEFIHRISTI: ...
    2. cfgrid inside a <cfoutput query="myQuery" group="GROUP">
      Is it possible to use a cfgrid inside a cfoutput with a query and a group. When I try do that I get the following error: INVALID_CHARACTER_ERR:...
    3. "cannot find server or DNS error" after installing 1394 card in XP system
      After intalling a 1394 firewire card in my xp machine, IE can no longer connect to the internet. Even after I remove the card and uninstall it...
    4. "Unable to find the plugin that handles this media type" - Shockwave
      Can anyone help me with this please? In DreamweaverMX, I insert a shockwave file on the webpage, and when I click on play I get that message. it...
    5. "The system cannot find the file specified." when invoking method ~HTTP Get/Post
      Developed and successfully tested my web service on a development server with .asmx mapped to v1.0.3705 \aspnet_isapi.dll, but when I migrated it...
  3. #2

    Default Re: "find duplicates" sql query

    Sorry - forgot to include original post:-

    I want to do a query that displays duplicate records in the database based
    on IP address. What syntax should I use in the WHERE********** bit please?

    Thanks,

    set rsData = con.execute("SELECT formtype, entrydate, ipaddress FROM
    formdata WHERE ************ ORDER BY ipaddress")
    arData = rsData.getrows


    David Guest

  4. #3

    Default Re: "find duplicates" sql query

    Please pick *ONE* newsgroup to post messages to. This is the correct one;
    asp.general is not.

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]




    "David" <david.brown@tesco.net> wrote in message
    news:O4Nlc.287$dl3.242@newsfe1-win...
    > Sorry - forgot to include original post:-
    >
    > I want to do a query that displays duplicate records in the database based
    > on IP address. What syntax should I use in the WHERE********** bit please?
    >
    > Thanks,
    >
    > set rsData = con.execute("SELECT formtype, entrydate, ipaddress FROM
    > formdata WHERE ************ ORDER BY ipaddress")
    > arData = rsData.getrows
    >
    >

    Aaron Bertrand - MVP Guest

  5. #4

    Default Re: "find duplicates" sql query

    Well I'll take a "stab" since no one else has. I think GROUP BY might be
    better than ORDER BY but decide that for yourself.

    To show all entries:
    SELECT formtype, entrydate, ipaddress FROM formdata GROUP BY ipaddress

    To show a specific IP#
    SELECT formtype, entrydate, ipaddress FROM formdata WHERE ipaddress = "<your
    input>" GROUP BY ipaddress"


    --

    Phillip Windell [MCP, MVP, CCNA]
    [url]www.wandtv.com[/url]


    "David" <david.brown@tesco.net> wrote in message
    news:O4Nlc.287$dl3.242@newsfe1-win...
    > Sorry - forgot to include original post:-
    >
    > I want to do a query that displays duplicate records in the database based
    > on IP address. What syntax should I use in the WHERE********** bit please?
    >
    > Thanks,
    >
    > set rsData = con.execute("SELECT formtype, entrydate, ipaddress FROM
    > formdata WHERE ************ ORDER BY ipaddress")
    > arData = rsData.getrows
    >
    >

    Phillip Windell Guest

  6. #5

    Default Re: "find duplicates" sql query

    SELECT formtype, entrydate, fd.ipaddress FROM formdata fd
    INNER JOIN
    (SELECT ipaddress, [count] = count(*)-1 FROM formdata GROUP BY by ipaddress)
    dup
    AND dup.ipaddress = fd.ipaddress AND dup.[count] > 0


    "David" <david.brown@tesco.net> wrote in message
    news:O4Nlc.287$dl3.242@newsfe1-win...
    > Sorry - forgot to include original post:-
    >
    > I want to do a query that displays duplicate records in the database based
    > on IP address. What syntax should I use in the WHERE********** bit please?
    >
    > Thanks,
    >
    > set rsData = con.execute("SELECT formtype, entrydate, ipaddress FROM
    > formdata WHERE ************ ORDER BY ipaddress")
    > arData = rsData.getrows
    >
    >

    Gary Jones Guest

Posting Permissions

  • You may not post new threads
  • You may 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