Is there no easy way to create a pivot table in DB2? I saw a few posts where a case statement was used, but those all dealt with a fixed number of columns. My data has a variable number of columns to convert.
We have jurors that come to court and we record the time in and time out. The groups could be called in every day of the term or only 1/2 of the days in the term. I need to create a pivot table that displays the date at the top of the column and each jurors times for that day below:
any ideas for dealing with the variable days?
the table is structured like:
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for anyone working with databases: The Fundamentals of Relational Database Design
We have jurors that come to court and we record the time in and time out. The groups could be called in every day of the term or only 1/2 of the days in the term. I need to create a pivot table that displays the date at the top of the column and each jurors times for that day below:
Code:
Juror 2/22/06 2/24/06 2/27/06 3/1/06
Jane Doe 9am - 10am 11am - 4pm 9am - 12pm
Bob Smith 10am - 6pm 9am - 3pm
John Adams 10am - 6pm
any ideas for dealing with the variable days?
the table is structured like:
Code:
JURNUM SERVDAT TIMETYPE TIMEIN TIMEOUT
12345 20060222 ORIENT 900 1000
12345 20060224 DLYPNL 1100 1600
12345 20060301 DLYPNL 900 1200
65432 20060224 DLYPNL 1000 1800
65432 20060227 JUROR 900 1500
54321 20060227 DLYPNL 1000 1800
Leslie
Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual
Essential reading for anyone working with databases: The Fundamentals of Relational Database Design