SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

Vadz
Starting Member

Fiji
11 Posts

Posted - 11/13/2012 :  22:56:10  Show Profile  Reply with Quote
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 - 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  
 New 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.69 seconds. Powered By: Snitz Forums 2000