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 2008 Forums
 Transact-SQL (2008)
 distinct records

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2013-11-11 : 01:51:50
Hi,
i try to get distinct records from a table

select distinct FuneralSite from deathdata

fetching records 259

i want to get address,state ,zip from the above record

i tried blow query but its wrong

select distinct FuneralSite,adress from deathdata
fetching reocrds 400


pls help me to

Desikankannan

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2013-11-11 : 02:42:41
then you need to decide which address you need to return with each of the site
The reason why count goes over 259 is because you've multiple addresses associated with each of the FuneralSite.

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
   

- Advertisement -