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)
 select distinct in one column

Author  Topic 

yoanilman1
Starting Member

2 Posts

Posted - 2010-08-31 : 12:09:58
I'm tasked to create a report where I've some duplicate value in column but I've to remove the duplicate from just one column. please see basic select report below:

Location_id Country Name phone
125 US JAY COSTA 4526558258
125 CA LAY CHIN 6525698255
125 NS GEORGE CHA 6289558965
462 CN FRANC BUTA 4895858546
462 BO ASHLY JHANG 1564557153
751 MX EMANUEL BONILLA 6529580320
751 NM JOSE NIKE 3205988221
751 NZ ANDREW GORENA 3986476050
751 BA MALLISA PORTILLO 6920571693

And this is what I need to show in report:

Location_id Country Name phone
125 US JAY COSTA 4526558258
CA LAY CHIN 6525698255
NS GEORGE CHA 6289558965
462 CN FRANC BUTA 4895858546
BO ASHLY JHANG 1564557153
751 MX EMANUEL BONILLA 6529580320
NM JOSE NIKE 3205988221
NZ ANDREW GORENA 3986476050
BA MALLISA PORTILLO 6920571693

Your help will be greatly appreciated.

Thanks,

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-31 : 12:19:22
That's a display issue.
Do it in your front end.
T-SQL wasn't made for that.


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

yoanilman1
Starting Member

2 Posts

Posted - 2010-08-31 : 14:04:39
I thought so, this would be more related to front end reporting issue. cannot be handled from the db query level.

thanks for the quick response!
Go to Top of Page
   

- Advertisement -