Advice Using Pivot Table in Oracle(在 Oracle 中使用数据透视表的建议)
问题描述
我需要一个报告,我应该使用数据透视表.报告将按类别分组.语句时使用 case 不好,因为类别很多.您可以将 Northwind 数据库视为示例,所有类别将是显示为列和报告将显示客户在类别中的偏好.我不知道其他解决方案,并在 Internet 中看到了 SQL Server 存储过程的示例.除了用例之外,您知道解决方案吗?
i need a report and i should use pivot table for it.Report will be group by categories .It is not good to use case when statement because there are many categories.u can think Northwind Database as sample and All Categories will be shown as Columns and Report will show customers preference among Categories.I dont know another solution and saw examples as Stored Procedures in Internet for Sql Server.Do u know a Solution except for using case when?
谢谢
推荐答案
一旦您获得 Oracle 11G,就会有一个 内置 PIVOT 功能.在此之前,您只能使用 CASE(或 DECODE)表达式.我在我的博客上有一篇关于如何自动执行此操作的文章.
Once you get Oracle 11G there is a built-in PIVOT feature. Prior to that, you are restricted to using CASE (or DECODE) expressions. I have an article on how to automate doing that on my blog.
这篇关于在 Oracle 中使用数据透视表的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 Oracle 中使用数据透视表的建议


- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- SQL 临时表问题 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01