我有此表视图枢轴/交叉表查询Oracle 10g中(动态列数)
UserName Product NumberPurchaces
-------- ------- ---------------
'John Doe' 'Chair' 4
'John Doe' 'Table' 1
'Jane Doe' 'Table' 2
'Jane Doe' 'Bed' 1
如何创建一个查询,将提供Oracle 10g的这一支点看法?
UserName Chair Table Bed
-------- ----- ----- ---
John Doe 4 1 0
Jane Doe 0 2 1
任何方式动态地做到这一点?我看到这么多的方法(解码,PL/SQL循环,工会,11G枢)
但我还没有找到的东西,会为我根据上面的例子中工作
编辑 :我不知道的产品开发时间的数量或类型所以这是动态的
你不能。任何特定的SQL语句必须返回结果集的列数,列的名称和列的数据类型 – 2010-08-13 23:38:03