Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 query returns 3 results, only want to see first 1

Author  Topic 

gb143
Starting Member

1 Post

Posted - 2001-10-22 : 11:10:15
Hey everyone, I have two tables.

ADDRESS

dr_id
type
addr1
city
state
zip


and

DrNAME
dr_id
fname
lname
specialty
org


Each doctor can have multiple address.

They are seperated in ADDRESS by the field TYPE in ADDRESS. 1,2,3,4,5,6,7,8

I currently do an inner join query where i want all the doctors with (3 or 6) as the type
so i get multiple records if they have two type 3's or both 3 and 6 or 3 and two 6's.

No matter how many 3's or 6's they have, i just want the doctor name to appear one time.

instead of

Dr Bill Hospital 3
Dr Bill Hospital 3
Dr Bill Hospital 6
Dr BOB Hospital 6

I would like to see just one of those records

Dr Bill Hospital 3
Dr BOB Hospital 6








Edited by - gb143 on 10/22/2001 11:16:55
   

- Advertisement -