Generate report for itself joined table

Hi all

I have a table in the following text:
Create table test
(
VARCHAR2 (30) class name.
number (5) number of grade
)

How can generate the report from the list of class for all grades in ONE SQL?

Name of the class of Grade 1
Class name1
Class name2
..
N class name
Name of the class for the students of 2nd year
Class name_1
Class name_2
...
Class name_n
...
Name of the class for year n
Class name_a
Class name_b
...
Class name_z


Thank you!

Hello.

It's almost what you want.

CREATE TABLE COURSE
(
     COURSE_NAME VARCHAR2(20) NOT NULL, --TYBE???
     GRADE_NUM NUMBER(3) NOT NULL  -- graDe
);

INSERT INTO course VALUES ('english-1',1);
INSERT INTO course VALUES ('french-1',1);
INSERT INTO course VALUES ('english-2',2);
INSERT INTO course VALUES ('french-2',2);
INSERT INTO course VALUES ('math-2',2);
INSERT INTO course VALUES ('english-3',3);
INSERT INTO course VALUES ('french-3',3);

SELECT
     DECODE(LEVEL,1,'For all Grade-')||
     child||
     DECODE(LEVEL,1,' students, the list of the courses are') something
FROM
(
     SELECT TO_CHAR(grade_num) child, null parent FROM course UNION
     SELECT course_name child, TO_CHAR(grade_num) parent FROM course
)
START WITH parent IS NULL
CONNECT BY PRIOR child = parent;

SOMETHING
--------------------------------------------------------------------------------------------
For all Grade-1 students, the list of the courses are
english-1
french-1
For all Grade-2 students, the list of the courses are
english-2
french-2
math-2
For all Grade-3 students, the list of the courses are
english-3
french-3                                                                                     

10 rows selected

I hope this helps.

Kind regards.

Tags: Database

Similar Questions

  • How do I display values skyrocket in the IR filter for the joined table columns?

    Hello

    I have a problem in the IR the query is based on a table, joined with other tables. I would like to provide users the ability to use IR filter search bar in the joined table columns. The problem facing on this filter, the Expression field, by pressing the arrow button displays values for the fields in the primary table, but not for fields that come from joined tables. Have you experienced this behavior in your reports? Is this normal?

    TIA

    Hello

    Correlated subqueries can improve performance - but it does not depend on the involved tables, the number of columns and the existence of indices. As far as I know, the optimizer has problems with them. You could try to explain the Plans on the two statements to verify that.

    In any case, I created a new test page with the SQL for IR:

    SELECT E.EMPNO,
    E.ENAME,
    D.DEPTNO,
    D.DNAME,
    E2.EMPNO "EMPNO2",
    E2.ENAME "ENAME2"
    FROM EMP E, EMP2 E2, DEPT D
    WHERE E.EMPNO = E2.EMPNO(+)
    AND E.DEPTNO = D.DEPTNO(+)
    AND E2.PRIMARY_EMPLOYEE(+) = 'Y'
    

    http://Apex.Oracle.com/pls/OTN/f?p=267:226

    As far as I can see, it works properly - except that if I do a filter on the ename column, when I try to create a second filter, drop-down lists ename all the values, while the other columns list only the available values after having applied the first filter. Which seems strange that the filters are applied as ANDS. But it does the same thing for other areas - IE, the field used in a filter is not filtered for the second filter - so I guess this is normal, but only a person in Apex could probably explain why it is so.

    Otherwise, everything seems to work as I expect and the above page works the same as my test page, which uses external joins http://apex.oracle.com/pls/otn/f?p=267:224

    Andy

  • Generate reports for ESX, VM, RAM, and CPU use list

    How will generate you a report for the list of ESX, VM, RAM and CPU used in your VSphere environment?

    Hello

    You can either use vCenter performance dashboards, select the chart options and chose the resource & corresponding metrics or select the host of the vSphere client, and then click file > report > summary of the host or Performance.

    Does that help?

  • How to generate the report for LUNS attached to esx

    Hi I m help esx 3.5 with vc 2.5 u 3 .we use 4 host cluster with 25 LUNs and attached to their creation of vm is very common in our production environment testing. can any body tell me the command or how so I can generate report for each lun attached to the esx like size of lun, used, free... second how vm, I on lun perticulr

    VDF h

    should meet your needs

  • Possibility to generate reports of RH Server 7 for CHM project?

    Hello
    We are developing aid for a new product needs.

    For the moment, we are looking to produce documentation in CHM format which will be set up as a context-sensitive help for a software application. Our team promotes the CHM on WebHelp format.

    However, there is still a requirement to be able to report on the use of headings in compiled help.

    Is it possible to generate RH Server7 reports on different topics within a help CHM project? Or RH Server 7 users can only generate reports for WebHelp projects?

    Thanks Rick! That's what we needed to know.

  • Remove the line from the Excel report when generating reports

    Hi all

    I try to delete whole lines of the report excel during the generation of the report in excel, but I'm not able to do this. Here I am attaching an excel template, in that I want to delete line no 3 to 5 How can I do this. I'm using LabVIEW 8.6 Report Generation Toolkit for Microsoft Office 1.1.3

    Thanks and greetings...

    If there is no function to generate report for simple operations like this, then use the palette of VBA macros to run this code snippet:

    'remove all lines between two rows inclusive '.
    Void DeleteRows (intTopRow As String, intLastRow As Integer)
    Range (cells (intTopRow, 1), (intLastRow, 1)). EntireRow.Delete xlShiftUp
    End Sub

    Import Excel module allows to load the .bas file then run Excel Macro with parameters 3 and 5.  Check your security settings if you get an error in the macro.

  • PowerCli script to generate the report for the VM and ESXi model

    Hello

    I'm trying to generate a report for the virtual machines to a domain controller that includes the operating system, Cluster and host of brand and model of ESXi, but for some reason any the ESXi info does not come through. Any help is greatly appreciated.

    Get-data center 'TEST ' |

    Get - vm |

    WHERE-object {$_.} PowerState - eq "Receptor"} |

    Select Name, @{N = "OS"; e = {$_.}} Extensiondata.Guest.GuestFullName}},

    @{N = "Cluster"; E={$_. VMHost.Parent}},

    @{N = 'Esxi model'; E = {Get-VMHost - VM $_.} VM | {{Select model}}

    The virtual machine has the properties of the host.  For your information "Model ESXi" use $_. VMhost.Model, $_ is the current information for pipeline for the virtual machine.  You did for the section "cluster".

  • Generate custom for the host storage reports

    Hello

    I have a use case where a I need to generate storage reports customized for i.e host host-> screen-> storage reports (reports on :) is an extension on reports taken hosts storage supported? I've seen examples of views views of performance or monitor. Please see the attachment for details

    If the case is taken over the extension on storage reports, we add another report for the reports on as an action?

    Thank you!

    Sorry, the points supported only buckets are those described in the SDK Programming Guide (and in document ExtensionPoints.html)

  • How to generate reports of Tuxedo (txrpt) for TMQFORWARD and TMQUEUE?

    Hi all

    And thanks in advance.

    Is it possible to generate reports of Tuxedo (txrpt) for TMQFORWARD? (we have not managed to do)

    While the Server\Service shows good results in the reports of Tuxedo, we noticed there are huge delays commits in long TMQFORWARD.

    1. If there is a way to monitor the TMQFORWARD?

    2. are there other tools, that we can use to monitor the passage of the validation of the overall transaction chain?

    Concerning
    Tech dims

    Published by: TechSgin on January 13, 2011 02:15
    The server\service TMQUEUE can be controlled like any other Service. We could not find a way to monitor the TMQFORWARD.

    Hi Tech sign,

    The best way to follow TMQFORWARD and transaction commit times accompany TSAM. TSAM can give you the treatment at the time to engage and help you recognize the resource manager that is causing the slow detailed commits.

    Kind regards
    Todd little
    Chief Architect of Oracle Tuxedo

  • The ANSI syntax for the join 4 tables-is this correct?

    Hi, I'm new to these forums and I have looked everywhere and cannot find the syntax and examples on how to join the tables 2 and 3 using the ANSI standard, but I need to reach 4. For a traditional join, it would be:

    SELECT a.two b.one, b.three, b, a.one, d.seven
    Tablea, tableb b, c in tablec, deposited d
    WHERE a.one = b.one
    AND a.two = c.two
    AND c.six = d.six;

    Here are the tables:

    TableB
    one
    three
    four

    TableA
    one
    two

    TableC
    two
    six

    deposited
    six
    seven
    eight

    Anyone know how to do this by using an ANSI join or have all of the resources that can guide me in the right direction. I don't know if I wanted to join three tables, it would be:

    SELECT a.two b.one, b.three, b, a.one, c.six
    FROM tableb b JOIN tablea one WE b.one = a.one JOIN tablec c ON a.two = c.two;

    so join a fourth would:

    SELECT a.two b.one, b.three, b, a.one, d.seven
    FROM tableb b JOIN tablea one WE b.one = a.one JOIN tablec c ON a.two = d JOIN filed c.two ON c.six = d.six;?

    Is the above correct or is there another way to do this, use an ANSI join?

    Published by: user1076466 on October 17, 2009 17:40

    Hello

    your JOIN looks good,

    "FROM tableb b JOIN tablea one WE b.one = a.one JOIN tablec c ON a.two = d JOIN filed c.two ON c.six = d.six" you get a different result set?

    Thank you

  • How it warns Oracle to use an index for the join of two tables...

    How to prevent the Oracle to use an index for the join of two tables to get a view online that is used in an update statement?

    O.K. I think I should explain what I mean:

    When you join two tables that have many entries sometimes there're better is not to use an index on the column that is used as a criterion to join.

    I have two tables: table A and table B.

    Table A has 4,000,000 entries and table B has 700,000 entries.

    I have a join of two tables with a numeric column as join criteria.

    There is an index on this column in A table.

    So I instead of
      where (A.col = B.col)
    I want to use
      where (A.col+0 = B.col)
    in order to avoid Oracle using the index.

    When I use the join in a select query, it works.

    But when I use the join as inline in an update statement I get the error ORA-01779.

    When I remove the '+ 0' the update statement works. (The column is unique in table B).

    Any ideas why this happens?

    Thank you very much in advance for any help.

    Hartmut cordially

    You plan to use a NO_INDEX hint as shown here: http://www.psoug.org/reference/hints.html

  • Generate reports based on two conditions

    Dear all,
    I generate reports based on satisfactory conditions in two columns in a table.

    For example.
    I have a table test1 with columns A, B, C, D, E
    Now, I want to create reports based on the research of two columns A and b. What is the preferred method to do?

    Thanks in advance.

    What is the preferred method to do?

    Write the appropriate query:

    select a,b,c,d,e
    from test1
    where a = 
    and b = 
    

    In reports, the State may be a user input parameter:

    select a,b,c,d,e
    from test1
    where a = :parameter1
    and b = :parameter2
    
  • join: table A > B > C where not always given in B

    Hello

    Asked me to add the description of the segment unit field to an existing report.

    View - a report containing several files/tables where one of the files is based on the schedule of payments table.

    With the help of the invoice_id, I seal A for the table of distribution (B) with an outer join because the Bill is not always in B. That everything is perfect.

    Using the combination of code id to B, I also defined a join of C, which includes descriptions of segment to B. It is a data standard join b is always c.

    I now have the description of the unit in the report, but this only works when the invoice code exists in B. If it does not exist, the entire line of data does not appear in the report. My problem is how can I set the join between B and C such that if the Bill does not exist in B, I will always get the rest of the data in the report (and just to have the description of the empty unit).

    In other words, if it was possible I would have defined A to C directly with an outer join.

    Is this possible? Since we are dealing with an existing report based on several records and not a single sql file, I don't want to rewrite the entire report.

    Thank you.
    Leah

    Hi Lea,.

    If I understand correctly, you can configure the joins in the Admin to do what you are trying to do. Looks like your A join B is correct (outer join on the detail), but to ensure that the B join C - you must implement as "outer on master join" with C as master. Initially, the option for "outer join on the master" is not available, but if you select "detail values do not exist in the main folder", then you can select "outer join on master. Which should allow you to include A table values when there is no matching record in B.

    Hope that helps,
    Martha

  • Form and a report on a related table, on the same page.

    Hello.

    I use Apex 2.1 in Oracle Express on Windows.

    I have a table, SUPPLIERS, whose primary key is ACCOUNT_CODE, and an INVOICES table, which has a column also called ACCOUNT_CODE, and of course the idea is ACCOUNT_CODE can be used to join the two tables.

    I created an application, then a 'form on a table with the report' for PROVIDERS, while I have page 1; a report on the SUPPLIERS and page 2; a form for editing a particular record of SUPPLIERS.

    So far so good.

    Now, on page 2, I also want to have a summary of the invoices of the supplier which I am editing the record. So I created a region and in a report on the BILLS.

    The question is: How can I make sure this invoice report shows only the records where the BILLS. ACCOUNT_CODE corresponds to the value of SUPPLIERS. That is currently used by the form ACCOUNT_CODE?

    Thank you
    Nick

    Hi Nick,
    If I understand your question then for the report of the Bills on the second page. do the SQL code for the report of something like:
    Select * from invoices where Account_Code =: P2_Form_Item_Containing_Account_Code_From_Suppliers.

    If you do not have this code of behalf of the providers already in the form, you could do a hidden and protected field that contains the account_code of this provider. I hope this helps.
    -Marc

  • Strange behavior with Report Generation Toolkit. Table does not table.

    We use a Word 2003 (.doc) document as a template for a summary of the report.  It works fine on the development PC.  It fills the fields in the document and fills the chart correctly, as shown in the picture below.

    However, he cannot even on another station.  Although the 2D table is identical and so is the software to investigate the matter, the table does not get filled correctly.  I studied using Word 2010 (.docx) as a model, with the same results.

    I was not able to understand what is different between stations 2 and why it does not work on the 2nd station.  I googled similar questions on the Web site of NOR and was only this article in the knowledge base concerning the new lines in the cell, which is not my case.

    That's what I have on the 2nd machine:

    The table that is sent to the table contains the appropriate data :

    I just found out this is a known bug, which obviously has not yet been resolved (finally... at least until LV2012SP1).

    See these threads:

    http://forums.NI.com/T5/LabVIEW/problem-with-append-table-and-Word-2010/TD-p/1268246

    and

    http://forums.NI.com/T5/LabVIEW/report-generation-MS-Word-table-bug/m-p/1605170

    I'll try the workarounds suggested and report back...

Maybe you are looking for