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.
| Author |
Topic |
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-07-22 : 05:20:57
|
| I have a table PageTracking. In this table information about page visits is stored against each visit. I want to make the path of pages visited against each visit. e.g.,if there is Visit 1 and Pages visited agaisnt this Visit areNote: Data is dummyVisit_ID Page1 www.Yahoo.com1 www.mail.yahoo.com1 www.yahoo.signout.comNow I want output like thisVisit_ID Path1 www.Yahoo.com->www.mail.yahoo.com->www.yahoo.signout.comNote:The result should be in one row. Currently I am doing this opening a cursor on Distinct Visit_ID. But this slows down the process as there could be 1 million rows. Please tell me some other fastest solution. |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-07-22 : 08:29:27
|
| Perhaps you did not understand my problem. I want to eliminate cursor and the reference you have given they are also using cursor, which I am already using. Comma and -> doesn't matter. Performance is the main issue. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-07-22 : 08:43:16
|
| Did you read it fully?See "The New and Improved Approach" as specified at the lastMadhivananFailing to plan is Planning to fail |
 |
|
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-07-22 : 09:07:01
|
| Yes I am doing the same way. Opening cursor on Visit_ID and against each visit makes the Path as select @path_dsc = coalesce(@path_dsc+'->', '') + page from tabble1but we can not get this thing like a column, this is a string in a variable. Can you tell me if I could get the same thing as a column.Then I will make a query with two columns Visit_ID and Path. Path would be the column made by using above statement. But I am unable to get this thing as a column. Please tell me how can I |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
bridge
Yak Posting Veteran
93 Posts |
Posted - 2005-07-22 : 10:00:26
|
| Thanks dear |
 |
|
|
|
|
|