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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Analysis Server and Reporting Services (2008)
 combine rows into distinct values
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

11 Posts

Posted - 11/13/2012 :  22:56:10  Show Profile  Reply with Quote

i want to combine a distinct rows values.i have this in my table

sentence person country
1 tom America
2 Mark china
1 tom America

been able to combine sentence into distinct value but i try to combine person and country it gives me error.anyone can help me on this

thanks in advance

Yak Posting Veteran

94 Posts

Posted - 11/17/2012 :  18:41:49  Show Profile  Reply with Quote
Create Table #TempTable
(Sentence int,
person varchar(10),
country varchar(25)

Insert into #TempTable Values(1,'tom','America')
Insert into #TempTable Values(2,'Mark','China')
Insert into #TempTable Values(1,'tom','America')

Select * From #TempTable

Select Distinct *
From #TempTable

Everyday life brings me back to reality
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000