Oracle数据库查询或存储过程 [英] Oracle pivot Query or stored procedure

查看:188
本文介绍了Oracle数据库查询或存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在构建与以下问题相关的查询或存储过程时遇到问题,所以任何人都可以帮我构建查询或与此相关的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆