Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to pull numbers that are the same

Status
Not open for further replies.

SteveLord

IS-IT--Management
Jun 7, 2006
360
US
NEWB ALERT!


Okay, so we run Sybase Anwhere 8 here along with InfoMaker 6. I have a database of doctors and want to run a query to check out if any have the same license number as another.

What is a SQL command that would detect duplicate numbers?

I am learning this as I go. Thanks.


 
Create a unique index on license number to prevent duplicates

To find already existing duplicates
select license, count(*)
from doctors
group by license
having count(*)>1
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top