List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:June 27 2001 9:56pm
Subject:Re: select query for duplicate records
View as plain text  
At 3:13 PM -0500 6/27/01, Pete Kuczynski wrote:
>Hi,
>How would a word a select statment, to search a database for duplicate
>entries in one field.
>
>For example, the fields: device, hostname, IP, comments
>
>I want to find all instances where there my be two devices with the same
>hostname.

SELECT hostname, COUNT(*) AS count FROM tbl_name
GROUP BY hostname HAVING count > 1


>
>Thanks!
>
>Pete
>--
>_______________________________________
>Pete Kuczynski
>Principal Field Engineer
>DHL Airways Inc.
>Infrastructure Technology & Services
>(773)-462-9758
>24/7 Helpdesk 1-800-434-5767


-- 
Paul DuBois, paul@stripped
Thread
select query for duplicate recordsPete Kuczynski27 Jun
  • Re: select query for duplicate recordsPaul DuBois27 Jun
  • Re: select query for duplicate recordsHannes Niedner28 Jun
  • Re: select query for duplicate recordsBob Hall28 Jun
  • Re: select query for duplicate recordsPete Kuczynski28 Jun
    • Re: select query for duplicate recordsPaul DuBois28 Jun
  • Re: select query for duplicate recordsPete Kuczynski28 Jun