Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 01:06 PM
David
Guest
 
Posts: n/a
Default "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("SELECT formtype, entrydate, ipaddress FROM
formdata WHERE ************ ORDER BY ipaddress")
arData = rsData.getrows


  #2  
Old July 19th, 2005, 01:06 PM
Hans
Guest
 
Posts: n/a
Default Re: "find duplicates" 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


  #3  
Old July 19th, 2005, 01:07 PM
Aaron Bertrand - MVP
Guest
 
Posts: n/a
Default Re: "find duplicates" 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.public.inetserver.asp.db

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


  #4  
Old July 19th, 2005, 01:07 PM
David
Guest
 
Posts: n/a
Default Re: "find duplicates" sql query

Access from Office 2000

"Hans" <hansb@sorry.nospam.com> wrote in message
news:eer8XdbMEHA.628@TK2MSFTNGP11.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]


 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles