SQL Query Question

Results 1 to 2 of 2

Thread: SQL Query Question

  1. #1
    Join Date
    Dec 1969

    Default SQL Query Question

    I have a DB with some 70k records. I need to create a query that will search all of the records to see if there are any matching &#039;RespondentUniqueKeys&#039;.<BR><BR>Each record has a ResponseID (Primary Key), and a RespondentUniqueKey. I need to search and return the records that have a RespondentUniqueKey that appears in another record also.<BR><BR>Thanks.

  2. #2
    Join Date
    Dec 1969
    Indianapolis, IN

    Default RE: SQL Query Question

    Try this:<BR>SELECT RespondentUniqueKey, COUNT(*)<BR>FROM mytable<BR>GROUP BY RespondentUniqueKey<BR>HAVING COUNT(*) &#062; 1

Posting Permissions

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