Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2004
    Posts
    101

    Unanswered: Delete Duplicate Rows

    Hi,
    I have the following query to select duplicate rows from the table. How can i delete them with out using temp table.

    select UserName, Title, Name, ColWidth, Sequence
    from table1 (nolock))
    Group by UserName, Title, Name, ColWidth, Sequence
    Having count(*) >1


    Any help would be greately appreciated.
    Thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    50
    Why don't you want to use a temp table?

    The easiest (don't know about fastest) way for med would be:

    1. Select DISTINCT into a temp table

    2. Truncate the original

    3. Select all the rows back.

    Interesting problem, if this can be done in one query.. It would be of use for me too.

  3. #3
    Join Date
    Feb 2004
    Location
    Bangalore, India
    Posts
    250
    hi,

    i posted a similar qn to the forum some time back. pl check the link below
    http://www.dbforums.com/t1003564.html

    btw, if you find any other gud solutions, pl let me know
    Cheers....

    baburajv

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •