Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
May 15, 1999

Finding duplicate values in a table

Question:
I have a table with the following fields:

Physician    Patient #       Procedure
One of the Procedures is "X-ray." How can I list the Patient # of anyone who has had more than one X-ray?

Answer:
select patient
from procedures
group by patient
where
procedure = 'X-ray'
having count(*) > 1

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date