Click here to Skip to main content
15,899,754 members
Home / Discussions / Database
   

Database

 
GeneralRe: What Query i have to used Pin
khan201028-Oct-09 21:42
khan201028-Oct-09 21:42 
QuestionJoining tables and get column with comma seperated values out of the join result Pin
nainakarri21-Oct-09 0:21
nainakarri21-Oct-09 0:21 
AnswerRe: Joining tables and get column with comma seperated values out of the join result [modified] Pin
J4amieC21-Oct-09 1:06
J4amieC21-Oct-09 1:06 
AnswerRe: Joining tables and get column with comma seperated values out of the join result Pin
i.j.russell21-Oct-09 1:51
i.j.russell21-Oct-09 1:51 
GeneralRe: Joining tables and get column with comma seperated values out of the join result Pin
Mycroft Holmes21-Oct-09 13:10
professionalMycroft Holmes21-Oct-09 13:10 
GeneralRe: Joining tables and get column with comma seperated values out of the join result Pin
i.j.russell21-Oct-09 21:41
i.j.russell21-Oct-09 21:41 
GeneralRe: Joining tables and get column with comma seperated values out of the join result Pin
Mycroft Holmes21-Oct-09 22:08
professionalMycroft Holmes21-Oct-09 22:08 
AnswerRe: Joining tables and get column with comma seperated values out of the join result Pin
Niladri_Biswas24-Oct-09 23:08
Niladri_Biswas24-Oct-09 23:08 
Try this

declare @pk_table table (id int)
insert into @pk_table select 1 union all select 2 union all select 3
union all select 4
declare @fk_table table (id int, string varchar(2))
insert into @fk_table
select 1,'x' union all select 1,'y' union all select 1,'z' union all
select 2,'a' union all select 2,'b' union all select 2,'c' union all
select 3,'d' union all select 3,'e' union all select 3,'f' union all
select 4,'g' union all select 4,'h' union all select 4,'i'

select cast(id as varchar(20)) + space(2) + cast(id as varchar(20)) + space(2) +
(select string + ','
	from @fk_table fkt
	where fkt.id = pkt.id
	FOR xml path('')) as OutputCol
	from @pk_table pkt
	group by pkt.id

Smile | :)

Niladri Biswas

GeneralRe: Joining tables and get column with comma seperated values out of the join result Pin
nainakarri25-Oct-09 19:12
nainakarri25-Oct-09 19:12 
GeneralRe: Joining tables and get column with comma seperated values out of the join result Pin
Niladri_Biswas26-Oct-09 15:54
Niladri_Biswas26-Oct-09 15:54 
QuestionAn Extraordinarily Dumb Question Pin
Roger Wright20-Oct-09 20:15
professionalRoger Wright20-Oct-09 20:15 
AnswerRe: An Extraordinarily Dumb Question Pin
SeMartens20-Oct-09 20:41
SeMartens20-Oct-09 20:41 
GeneralRe: An Extraordinarily Dumb Question Pin
Roger Wright21-Oct-09 3:12
professionalRoger Wright21-Oct-09 3:12 
AnswerRe: An Extraordinarily Dumb Question Pin
i.j.russell21-Oct-09 3:09
i.j.russell21-Oct-09 3:09 
GeneralRe: An Extraordinarily Dumb Question Pin
Roger Wright25-Oct-09 21:40
professionalRoger Wright25-Oct-09 21:40 
GeneralRe: An Extraordinarily Dumb Question Pin
Gary R. Wheeler29-Oct-09 13:04
Gary R. Wheeler29-Oct-09 13:04 
GeneralRe: An Extraordinarily Dumb Question Pin
Roger Wright29-Oct-09 18:04
professionalRoger Wright29-Oct-09 18:04 
QuestionPrimary key on Bit Datatype in sql server 2000 Pin
Tufail Ahmad20-Oct-09 19:30
Tufail Ahmad20-Oct-09 19:30 
AnswerRe: Primary key on Bit Datatype in sql server 2000 Pin
Mycroft Holmes20-Oct-09 19:53
professionalMycroft Holmes20-Oct-09 19:53 
AnswerRe: Primary key on Bit Datatype in sql server 2000 Pin
Eddy Vluggen20-Oct-09 23:32
professionalEddy Vluggen20-Oct-09 23:32 
GeneralRe: Primary key on Bit Datatype in sql server 2000 Pin
Mycroft Holmes21-Oct-09 0:44
professionalMycroft Holmes21-Oct-09 0:44 
GeneralRe: Primary key on Bit Datatype in sql server 2000 Pin
Eddy Vluggen21-Oct-09 0:57
professionalEddy Vluggen21-Oct-09 0:57 
JokeRe: Primary key on Bit Datatype in sql server 2000 Pin
Mycroft Holmes21-Oct-09 1:01
professionalMycroft Holmes21-Oct-09 1:01 
GeneralRe: Primary key on Bit Datatype in sql server 2000 Pin
Eddy Vluggen21-Oct-09 1:29
professionalEddy Vluggen21-Oct-09 1:29 
QuestionAvoid login for BUILTIN\Administrator Pin
ArielR20-Oct-09 11:54
ArielR20-Oct-09 11:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.