Jeff, why not this (off of top of my head, so syntax surely wrong...)

delete
where key in (
    select key, count(key) as DupCount
    from D1.field = d2.field AND (continue for all fields that will ensuer
that only duplicates included)
    group by (same list as from)
    having DupCount > 1
)
  -----Original Message-----
  From: Jeff Waris [mailto:[EMAIL PROTECTED]
  Sent: Friday, April 16, 2004 2:35 PM
  To: CF-Talk
  Subject: OT: SQL question. Someone help!!!

  I am having a hard time finding the right syntax in SQL. Backend Database is
  SQL Server 7

  What I am trying to acomplish. I have some duplicate records that I need to
  get rid of, the problem is that all these records already have a unique key,
  but the rest of the fields are the same. I was hoping to be able to join two
  fieldnames together and look for the duplicates that way..

  For example... this is where I was headed...

  Select from billing.first_name+ billing.last_name AS combined
  HAVING COUNT( * ) > 1

  It wouldn't work.... Any help would greatly be appreciated.

  Jeff
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to