SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    H-Town
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Find Dups in SQL Query help

    I have searched the web but have not found exactly what I am looking for. I need a query that will list the duplicates in table. Let's say I have a table w/ three columns : TapeNum, Box, and Location. I would like to find all duplicates in the TapeNum column or a tape number that appears more than once. Thanks.

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,220
    Mentioned
    58 Post(s)
    Tagged
    3 Thread(s)
    Code:
    select TapeNum
         , Box
         , Location
      from yourtable
     where TapeNum
        in ( select TapeNum
               from yourtable
             group
                 by TapeNum
             having count(*) > 1 )
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    H-Town
    Posts
    28
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks I'll give it try A.S.A.P


Bookmarks

Posting Permissions

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