September 14, 2011 at 1:50 am
Hi ,
The Following query needs to be execute in sql server 2000 environment.
I have two tables like tab and tabcomments
tab table structure look like this....
create table dbo.tab(appid int,comment varchar(5000))
create table dbo.tabcomment(commentid int identity(1,1),appid int,comment varchar(5000)
insert into dbo.tab values(1000,' ')
insert into dbo.tab values(1001,' ')
---------------------------
select * from dbo.tab
--------------------
appid comment
1000
1001
insert into dbo.tabcomment values(1000,'read')
insert into dbo.tabcomment values(1000,'book')
insert into dbo.tabcomment values(1000,'notepad')
insert into dbo.tabcomment values(1001,'scriblingpad')
insert into dbo.tabcomment values(1001,'advancedPC')
-------------------------------
select * from dbo.tabcomment
-----------------------------
Commentid,appid, comment
1 1000 read
2 1000 book
3 1000 notepad
4 1001 scriblingpad
5 1001 advancedPC
----------------------------------------------------
we are expecting the result like this
select * from dbo.tab
---------------------------
appid Comment
1000 read,book,notepad
1001 scriblingpad,advancedPC
----------
could you please let me know, how can i achive this result. If you have any script, kinldy share with me..
Thanks & Regards
Balaji G
September 14, 2011 at 2:00 am
Unfortunately, SQL 2000 doesn't offer that many options.
One solution I can think of is to use a function.
An example can be found at Adam Machanics blog
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply