Oracle数据库查询或存储过程 [英] Oracle pivot Query or stored procedure
问题描述
我在构建与以下问题相关的查询或存储过程时遇到问题,所以任何人都可以帮我构建查询或与此相关的SP
表名: ABC
RefID高级版Service_tax
RF001 18000 V.1 1200
RF001 17000 V.2 1300
RF001 19000 V.3 1500
我想要以下格式的数据
福利V.1 V.2 V.3
Premium 18000 17000 19000
Service_tax 1200 1300 1500
< blockquote>首先,尝试做点什么。以下是针对Oracle的pivot和unpivot查询的非常好的解释:链接 [< a href =http://www.oracle.com/technetwork/articles/sql/11g-pivot-097235.html\"target =_ blanktitle =New Window> ^ ]
I am facing problem in building query or stored procedure related to below issue so can any one help me for building query or SP related to this
Table Name : ABC
RefID Premium Version Service_tax
RF001 18000 V.1 1200
RF001 17000 V.2 1300
RF001 19000 V.3 1500
I want data in below format
Benefits V.1 V.2 V.3
Premium 18000 17000 19000
Service_tax 1200 1300 1500
First of all, try to do something. Here is quite good explanation of pivot and unpivot queries for Oracle: link[^]
这篇关于Oracle数据库查询或存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!