On 21/11/2012 16:40, [email protected] wrote:
Hi John,
I think a smart SQL-Statement schould do.
OK that would probably a bit inflxible, since you have a lot of changes 
concerning users and products.
But you could may be write a SQL-Generating routine that takes care of it.

I have to do that anyway since the query to diplay the table changes with the table layout, and all the temporary table stuff involves creating lots of SQL dynamically.

I googled a bit and found examples (for other database-systems) but a bit 
modified it should work also for derby.
Maybe with derby's case expression it could work.
Here an example function.
[...snip...]
Found in 
http://www.simple-talk.com/sql/t-sql-programming/creating-cross-tab-queries-and-pivot-tables-in-sql/

Thanks, it looks promising; I'll have a long think about this!
--
John English

Reply via email to