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
 Analysis Server and Reporting Services (2008)
 combine rows into distinct values

Author  Topic 

Vadz
Starting Member

11 Posts

Posted - 2012-11-13 : 22:56:10
hi

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

LarryC74
Yak Posting Veteran

94 Posts

Posted - 2012-11-17 : 18:41:49
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
   

- Advertisement -