Query Writing
459816Jan 31 2006 — edited Jun 11 2008Hi,
I have a table with data stored in following format.
Col1 Col2 Col3
------------------------
P1 A 101102
P1 A 103104
P1 B 102105
P2 A 101105
P2 B 101103
P2 C 102104
Want to have query that will retrive the records in the following format
and store them in a staging table.
Col1 Col2 Col3
------------------------
P1 A,A,B I101,I102,I103,I104,I102,I105
P2 A,B,C I101,I105,I101,I103,I102,I104
How should i write the query? Can any one give me the solution.
Can it be done with a single query or i need to write a procedure or function to do this. If so then solution will be very much helpful.
Regards
Swadhin