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 中使用数据透视表的建议


基础教程推荐
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01