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, [EMAIL PROTECTED]

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to