"find duplicates" sql query

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • David

    "find duplicates" sql query

    Hi,

    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("SE LECT formtype, entrydate, ipaddress FROM
    formdata WHERE ************ ORDER BY ipaddress")
    arData = rsData.getrows


  • Hans

    #2
    Re: "find duplicates&quot ; sql query

    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


    Comment

    • Aaron Bertrand - MVP

      #3
      Re: "find duplicates&quot ; sql query

      > in the database

      Please tell us what you mean. What type of database, Oracle, SQL Server,
      Sybase, Access, DB2, ...? What version?

      Please follow up in microsoft.publi c.inetserver.as p.db

      --
      Aaron Bertrand
      SQL Server MVP



      Comment

      • David

        #4
        Re: "find duplicates&quot ; sql query

        Access from Office 2000

        "Hans" <hansb@sorry.no spam.com> wrote in message
        news:eer8XdbMEH A.628@TK2MSFTNG P11.phx.gbl...[color=blue]
        > Hi!
        >
        > I don't know which database you are using but something like this might[/color]
        work[color=blue]
        > (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
        >
        >[/color]


        Comment

        Working...