Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

Re: (almost) duplicates
Thanks Hugo - I'm not sure if this will work for me as the time may expand
beyond a set periord of seconds (maybe to a few minutes?).  I get the gist
though - I appreciate your help and explaination!

Jeff

"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
 news:92nj411t3o257gh
 sm8jfm3oicddhrc6p3k@
4ax.com...
> On Mon, 28 Mar 2005 10:35:43 -0500, J. Clarke wrote:
> 
>
> Hi Jeff,
>
> Assuming Col1, Col2 and Col3 are exactly the same and Col4 is the
> datetime column with a few seconds difference, and that you want to
> delete the duplicates if the time difference is no more than 20 seconds,
> use:
>
> DELETE FROM MyTable
> WHERE EXISTS
> (SELECT    *
>  FROM      MyTable AS b
>  WHERE     b.Col1  = MyTable.Col1
>  AND       b.Col2  = MyTable.Col2
>  AND       b.Col3  = MyTable.Col3
>  AND       b.Col4  < MyTable.Col4
>  AND       b.Col4 >= DATEDIFF(second, 20, MyTable.Col4))
> (untested)
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)



Report this thread to moderator Post Follow-up to this message
Old Post
J. Clarke
03-31-05 12:03 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 01:20 PM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006