Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: SQL-Server
I have scenario like
 
User | Session | Response
_________________________
 u1  |   s1    |    r1
_________________________
 u1  |   s1    |    r2
_________________________
 u1  |   s2    |    r3
_________________________
 u2  |   s2    |    r4
_________________________
 u2  |   s2    |    r5
AND the Output needs to be Like
 
OUT PUT Table
________________
 
User  | Session  | response1  | response2  | Session.....n
________________________________________
u1    |  s1      |   r1       |  r2       
________________________________________
u1    |  s2      |   r3       |  NULL   
________________________________________
u2    |  s2      |   r4       |  r5      
That Session column may be n time depending upon number responses.
 
Waiting For response
Thanks in Advance
 
[edit]text block added[/edit]
Posted 14-Nov-12 4:39am
Edited 14-Nov-12 6:36am
v5
Comments
joshrduncan2012 at 14-Nov-12 11:44am
   
How is your output developed? We can't help until we see how you have it developed so far.
anil.luck at 14-Nov-12 12:41pm
   
Need to write script which will develop a table like OUT PUT table

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

That's called 'pivot table[^].
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140926.1 | Last Updated 15 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100