Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Location
    Netherlands
    Posts
    98

    Question Unanswered: Searching double values

    Hi,
    I have a table with lots of records init and i want to make a simple query where i can show only the records with more then 1 time the same value,
    problem is that i want to make a collumn primary key and there are still double values in it.

    Thanx in front
    Cheers Wimmo

  2. #2
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Post some DDL

    But maybe?

    Code:
    SELECT * 
      FROM myTable99 o 
     WHERE EXISTS ( SELECT i.key 
    		  FROM myTable99 i 
    		 WHERE o.key = i.key 
    	      GROUP BY i.key 
    		HAVING COUNT(*) > 1)
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  3. #3
    Join Date
    Oct 2003
    Location
    Netherlands
    Posts
    98
    Quote Originally Posted by Brett Kaiser
    Post some DDL

    But maybe?

    Code:
    SELECT * 
      FROM myTable99 o 
     WHERE EXISTS ( SELECT i.key 
    		  FROM myTable99 i 
    		 WHERE o.key = i.key 
    	      GROUP BY i.key 
    		HAVING COUNT(*) > 1)
    Thanx Brett, this hit the spot!!

Posting Permissions

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