Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 30th, 2004, 06:25 AM
Authorized User
 
Join Date: May 2004
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to saravananedu
Default matrix report output

i need an urgent query.

i've to display a table contents in a matrix format.

table is: material_stock

the o/p will look like:

plant/materials material1 material2 materia l3 ....

plant1 actualqty actualqty actualqty   

plant2 actualqty actualqty actualqty

plant3 actualqty actualqty actualqty

.
.
.

have u got it?

I'LL TELL U IN DETAIL.

TABLE IS:

CREATE TABLE MATERIAL_STOCK(PART_NUMBER VARCHAR2(20),
PLANT CHAR(4),PHYSICAL QUANTITY NUMBER(30,3),
ACTUAL QUANTITY NUMBER(30,3));

OUTPUT SHOULD LOOK LIKE:

Plant Material 1 Material 2 Material 3
plantcode1 qty qty qty
plantcode2 qty qty qty
plantcode3 qty qty qty
plantcode4 qty qty qty
--


hope ur reply soon.

Thanks in advance.

Yours,
Saran
__________________
Best Regards,
Saran.
 
Old March 3rd, 2005, 10:20 AM
Registered User
 
Join Date: Feb 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to SureshHyd
Default

Look at this example query with sample output:
        SELECT *
        FROM (SELECT job,
                      sum(decode(deptno,10,sal)) DEPT10,
                      sum(decode(deptno,20,sal)) DEPT20,
                      sum(decode(deptno,30,sal)) DEPT30,
                      sum(decode(deptno,40,sal)) DEPT40
                 FROM scott.emp
                GROUP BY job)
        ORDER BY 1;

        JOB DEPT10 DEPT20 DEPT30 DEPT40
        --------- ---------- ---------- ---------- ----------
        ANALYST 6000
        CLERK 1300 1900 950
        MANAGER 2450 2975 2850
        PRESIDENT 5000
        SALESMAN 5600





Similar Threads
Thread Thread Starter Forum Replies Last Post
Displaying Matrix Report Ahmed-Deq Classic ASP Basics 3 February 19th, 2008 11:56 PM
Matrix report issue aranjan BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 February 4th, 2007 02:42 AM
fusion between matrix and tabular report.. johnnygut Reporting Services 0 November 16th, 2006 04:15 PM
matrix report rhbandagi Classic ASP Databases 0 March 24th, 2006 04:06 AM
2 independent Column Groups in report matrix? Andrei Reporting Services 1 February 21st, 2006 12:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.