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
 SQL Server Development (2000)
 Sql Query Help ( MS Access)

Author  Topic 

mrkalakota
Starting Member

3 Posts

Posted - 2005-05-23 : 12:17:27
Somebody pls. help me.

I have a table called Facility which has Id, Name, City, State, Add1, Add2 columns and Id has a unique constraint.

I want Add1, Add2 columns based on the combination of (Name, City, State) having count = 1 if their count is > 1 then I dont need that record.

Thanks

Madhu

JimL
SQL Slinging Yak Ranger

1537 Posts

Posted - 2005-05-23 : 14:30:39
Are you asking how to get rid of duplicte records based on (Name,City State) ?

To display last created
Select min(ID),count(*)
From Facility
group by Name,City,State
having count(*) > 1

Jim
Users <> Logic
Go to Top of Page

AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2005-05-23 : 19:24:23
Also, see my response in your other post: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=50149

By the way, most of us scan all the forums here, so you do not need to post your question more than once. Posting it into the Access forum was the best place for it.

---------------------------
EmeraldCityDomains.com
Go to Top of Page
   

- Advertisement -