Query to display data with total

Hi team,

I have the whee requirement I need to display data with total and the total general.

Examples of data include:

with t as 
(select 'chris' nm , 10 no ,'FT' Emplmt, 'PF' ProFund , 'Reg' Status ,to_Date ('05/02/2014','mm/dd/yyyy') dt , 2456 sal, 10 days , 50 intrst ,55 intrs1 ,60 intrs2 from dual
union all
select 'chris' nm , 10 no ,'FT' Emplmt, 'PF' ProFund , 'Reg' Status ,to_Date ('06/10/2014','mm/dd/yyyy') dt , 1000 sal, 30 days , 50 intrst ,55 intrs1 ,60 intrs2 from dual
union all
select 'chris' nm , 10 no ,'FT' Emplmt, 'PF' ProFund , 'NonReg' Status ,to_Date ('06/10/2014','mm/dd/yyyy') dt , 20 sal, -5 days , 1 intrst ,1 intrs1 ,1 intrs2 from dual
union all
select 'john' nm , 11 no ,'PT' Emplmt, 'PF' ProFund , 'Reg' Status ,to_Date ('05/02/2014','mm/dd/yyyy') dt , 1153 sal, 10 days , 50 intrst ,55 intrs1 ,60 intrs2 from dual
union all
select 'john' nm , 11 no ,'PT' Emplmt, 'PF' ProFund , 'Reg' Status ,to_Date ('05/16/2014','mm/dd/yyyy') dt , 1000 sal, 8 days , 40 intrst ,45 intrs1 ,50 intrs2 from dual
)
select * from t 

Need the output like below format

Chris FT 10 PF Reg 02/05/2014 2456 10 50 55 60

Chris FT 10 Reg 10/06/2014 1000 PF 30 50 55 60

Chris 10 FT PF NonReg 10/06/2014 20 - 5 1 1 1

5456 35 101 111 121 subtotal

John PT PF Reg 02/05/2014 1153 11 10 50 55 60

John PT Reg 16/05/2014 1000 PF 11 8 40 45 50

2153 18 90 100 110 subtotal

7609 total 53 191 211 231

Could you please give some thought to get the result as above.

Thank you!

something like this:

with t as (select "chris" nm, 10 no, "Pi" Emplmt, "PF" ProFund "Reg" Status, to_Date (May 2, 2014 "," mm/dd/yyyy") dt, 2456 sal, 10 days, 50 intrst, intrs1 55 intrs2 60 double)

Union of all the

Select "chris" nm, 10 no, "Pi" Emplmt, "PF" ProFund "Reg" Status, to_Date (June 10, 2014 "," mm/dd/yyyy") dt, intrst 50, intrs1 55, 1000 sal, 30 days, 60 intrs2 of the double

Union of all the

Select "chris" nm, 10 no, "Pi" Emplmt, ProFund "PF", "NonReg" State, to_Date (June 10, 2014 "," mm/dd/yyyy") dt, 20 sal,-5 days, 1 intrst, 1 intrs1, 1 intrs2 of the double

Union of all the

Select "Jean" nm, 11 no, "PT" Emplmt, "PF" ProFund "Reg" Status, to_Date (May 2, 2014 "," mm/dd/yyyy") dt, 1153 sal, 10 days, 50 intrst, intrs1 55 intrs2 60 double

Union of all the

Select "Jean" nm, 11 no, "PT" Emplmt, "PF" ProFund "Reg" Status, to_Date (16 may 2014 "," mm/dd/yyyy") dt, 1000 sal, 8 days, intrst 40, 45 intrs1, 50 intrs2 of the double

)

SELECT decode (REUNION (nm), 1, 'Total', decode (grouping (State), 1, "partial": nm, nm)) nm

, no, emplmt, profund, status, dt, sum (sal), sum (days), sum (intrst), sum (intrs1), sum (intrs2)

T

Rollup Group (nm, (no, emplmt, profund, status, dt));

HTH

Tags: Database

Similar Questions

  • query to display data in table with several detail table

    Hi all

    I have a few cases with a table header that have more than 3 table of detail, and I have to generate the query to show all the data horizontally.

    tblHdr have column A (PK)

    tblDtl1 have column A (FK), B (PK)

    tblDtl2 have column A (FK), C (PK)

    tblDtl3 have column A (FK), D (PK)

    and I need a query to display data like this:

    AB1C3D1
    AB2C4D2
    AC5D3
    AC6

    all the Details of the table should display data based on the relationship of tblHdr (A).

    tblDtl1 have only 2 rows of data for the FK A

    tblDtl2 just for FK 4 lines of data

    tblDtl3 only 3 lines of data for the FK A

    Another example:

    AB1C1D1
    AB2C2
    A

    B3

    tblDtl1 only 3 lines of data for the FK A

    tblDtl2 have only 2 rows of data for the FK A

    tblDtl3 have only 1 rows of data for the FK A

    Please shed some light. for the record, I'll use this query in ADF, so I'll put using PLSQL in second priority.  I prefer to do it in the SQL query.

    Thank you

    Here are 3 ways. First test of data:

    drop table ta purge;
    create table ta as
    SELECT 'A' AS A FROM dual
    union all
    select 'B' from dual;
    
    drop table tb purge;
    create table tb as
    SELECT 'A' AS A, 'B1' AS B FROM dual
    UNION ALL
    SELECT 'A', 'B2' FROM dual ;
    
    drop table tc purge;
    create table tc as
    SELECT 'A' AS A, 'C1' AS C FROM dual
    UNION ALL
    SELECT 'A', 'C2' FROM dual
    UNION ALL
    SELECT 'A', 'C3' FROM dual
    UNION ALL
    SELECT 'A', 'C4' FROM dual ;
    
    drop table td purge;
    create table td as
    SELECT 'A' AS A, 'D1' AS D FROM dual
    UNION ALL
    SELECT 'A', 'D2' FROM dual
    UNION ALL
    SELECT 'A', 'D3' FROM dual;
    

    Now 3 solutions: full join, group by and pivot:

    with b as (
      select a, b,
      row_number() over(partition by a order by b) rn
      from tb
    )
    , c as (
      select a, c,
      row_number() over(partition by a order by c) rn
      from tc
    )
    , d as (
      select a, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    select a, b, c, d
    from ta left join b using(a)
    full join c using(a, rn)
    full join d using(a, rn)
    order by a, rn;
    
    select a, max(b) b, max(c) c, max(d) d
    from (
      select a, null b, null c, null d, 1 rn
      from ta
      union all
      select a, b, null, null,
      row_number() over(partition by a order by b) rn
      from tb
      union all
      select a, null, c, null,
      row_number() over(partition by a order by c) rn
      from tc
      union all
      select a, null, null, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    group by a, rn
    order by a, rn;
    
    select A,B,C,D from (
      select 'A' tab, a, null val, 1 rn from ta
      union all
      select 'B' tab, a, b,
      row_number() over(partition by a order by b) rn
      from tb
      union all
      select 'C' tab, a, c,
      row_number() over(partition by a order by c) rn
      from tc
      union all
      select 'D' tab, a, d,
      row_number() over(partition by a order by d) rn
      from td
    )
    pivot(max(val) for tab in('B' B, 'C' C, 'D' D))
    order by a, rn;
    
    A B C D
    A B1 C1 D1
    A B2 C2 D2
    A C3 D3
    A C4
    B

    Personally, I would prefer to view the data by using a 'join the union', in order to avoid the impression that the different detail records are related somehow.

    select ta.a, b, c, d
    from tb full join tc on 1=0
    full join td on 1=0
    right join ta on ta.a in (tb.a, tc.a, td.a);
    
    A B C D
    A B1
    A B2
    A C1
    A C2
    A C3
    A C4
    A D1
    A D2
    A D3
    B
  • Writing a query to display data WHERE the data in column do not begin with 'Rep '.

    Hello

    * (Assuming file_name is a column of table $file_log) *.

    Please tell me

    How to write a query where I want to display the data for which File_Name does not begin with name like Reports_

    Please tell me.

    Thank you

    Hello

    I hope that this might help

    SELECT * FROM FILE_LOG_TABLE WHERE FILE_NAME NOT LIKE 'Reports_%';
    

    see you soon

    VT

  • PDM Viewer do not display data with time stamp

    Need help with the timestamp of the data in a PDM file generated by the DAQ Assistant.

    When I use the PDM Viewer, with x the value absolute time scale, the date starts in 1903. If I use Excel to look at the file that the start time is correct (i.e. 2013).

    Bo_Xie, I simplified my VI and now able to display the correct time stamp. Thanks for your time!

  • Build the query to select date with status

    Hi guys,.

    Grateful if you can advise me on how to build the query on below scenario:

    Table A

    Date

    11.44.39.000000000 12-OCT-14 AM ASIA/SINGAPORE

    11.44.35.000000000 16-SEP-14 AM ASIA/SINGAPORE

    11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE

    The result of the query:

    Date                                                                                            Status

    11.44.39.000000000 12-OCT-14 AM ASIA / SINGAPORE inactive

    11.44.35.000000000 16-SEP-14 active AM ASIA/SINGAPORE

    11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE inactive

    Basically, the logic, I wanted is

    Active principles: today date or max (date) < sysdate

    Otherwise will be inactive

    And there is 1 active date in time.

    Thanks in advance

    Hello

    2753165 wrote:

    Hi guys,.

    Grateful if you can advise me on how to build the query on below scenario:

    Table A

    Date

    11.44.39.000000000 12-OCT-14 AM ASIA/SINGAPORE

    11.44.35.000000000 16-SEP-14 AM ASIA/SINGAPORE

    11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE

    The result of the query:

    Date                                                                                            Status

    11.44.39.000000000 12-OCT-14 AM ASIA / SINGAPORE inactive

    11.44.35.000000000 16-SEP-14 active AM ASIA/SINGAPORE

    11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE inactive

    Basically, the logic, I wanted is

    Active principles: today date or max (date)<>

    Otherwise will be inactive

    And there is 1 active date in time.

    Thanks in advance

    Sorry, we don't know what you want.

    Are you saying that 1 row (maximum) can be assigned status = 'Active' and if 2 or more lines are eligible, the last of them will be called 'Active'?

    If so:

    CASE

    WHEN tmstmp<=>

    OR ROW_NUMBER () OVER (PARTITION BY CASE

    WHEN tmstmp<=>

    THEN "could be."

    ANOTHER 'No Way'

    END

    ORDER BY tmstmp DESC

    )  = 1

    THEN "active."

    ELSE 'inactive '.

    END

    If you would care to post CREATE TABLE and instructions INSERT for some samples, so I could test it.

    DATE is not a very good name for a column, especially if the column is a TIMESTAMP, not a DATE.  I called the TMSTMP instead of the DATE column.

  • Display data with sql

    Hello

    create TABLE EMP ( )

    Emp_id NUMBER ,

    DATE of DT_FROM ,

    DATE of DT_TO ,

    CREATE_DATE DATE)

    into EMP

    (ID_EMP, DT_FROM, DT_TO, CREATE_DATE)


    Values


    ()100 TO_DATE (March 1, 2001 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (June 30, 2001 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (1 May 2001 05:44:20 ', ' MM/DD/YYYY HH24:MI:SS '));



    into EMP


    ()Emp_id DT_FROM DT_TO CREATE_DATE( )


    Values


    ()100 TO_DATE (1 July 2008 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (April 30, 2012 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (May 8, 2009 14:11:21 ', ' MM/DD/YYYY HH24:MI:SS '));



    into EMP


    (ID_EMP, DT_FROM, DT_TO, CREATE_DATE)


    Values


    ()100 TO_DATE (1 June 2008 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (April 30, 2012 00:00:00 ', "MM/DD/YYYY HH24:MI:SS"), TO_DATE (June 26, 2009 15:48:15 ', ' MM/DD/YYYY HH24:MI:SS '));



    into EMP


    (ID_EMP, DT_FROM, DT_TO, CREATE_DATE)


    Values


    ()100 TO_DATE (September 30, 2012 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (September 30, 2012 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (September 28, 2012 17:13:52 ', ' MM/DD/YYYY HH24:MI:SS '));



    into EMP


    (ID_EMP, DT_FROM, DT_TO, CREATE_DATE)


    Values


    ()100 TO_DATE (October 1, 2012 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (30 April 2013 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (December 14, 2012 11:42:15 ', ' MM/DD/YYYY HH24:MI:SS '));



    into EMP


    (ID_EMP, DT_FROM, DT_TO, CREATE_DATE)


    Values


    ()100 TO_DATE (31 May 2013 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (31 May 2013 00:00:00 ', ' MM/DD/YYYY HH24:MI:SS '), TO_DATE (May 8, 2013 13:26:30 ', ' MM/DD/YYYY HH24:MI:SS '));




    expected results:




    DT_FROM DT_TO

                     03 / 01 / 2001           06/30/2001



                     06 / 01 / 2008           04/30/2012



                     09 / 30 / 2012           09/30/2012



                     10 / 01 / 2012           04/30/2013



                     05 / 31 / 2013           05/31/2013




    reason for with the exception of the the 1 July 2008 ' line is there is another line with less dt_from value that was created after this line created. If there is a sub sequent row


    less dt_from value and latest creation date we need to get that line and exclude the lines as over a.

    Thank you

    Hello

    So, you need to know if there is a previous dt_from on a line more later (where 'later' is determined by create_date).  This sounds like a job for the analytical MIN function:

    WITH got_min_dt_from AS

    (

    SELECT dt_from, dt_to

    , MIN (dt_from) over (PARTITION BY emp_id - just guessing

    ORDER BY DESC create_date

    ) AS min_dt_from

    WCP

    )

    SELECT dt_from, dt_to

    OF got_min_dt_from

    WHERE dt_from = min_dt_from

    ORDER BY dt_from

    ;

    Emp_id play a role in this problem?  It is difficult to say when all the rows of the data sample has the same value.

  • I want to display date with day between sysdate to a date later one in sql

    SYSDATE to 21/09/2014

    It should display as

    @@@

    wednessday 08/06/2014

    Thursday 08/07/2014

    08/08/2014 Friday

    Saturday 08/09/2014

    .

    .

    .

    .

    .

    .

    .

    21/09/2014 Sunday

    SQL> select sysdate + (level-1) dt
      2       , to_char(sysdate + (level-1), 'fmDay') dt_day
      3    from dual
      4  connect by level <= to_date('21-09-2014', 'dd-mm-yyyy') - sysdate + 1;
    
    DT        DT_DAY
    --------- ---------
    06-AUG-14 Wednesday
    07-AUG-14 Thursday
    08-AUG-14 Friday
    09-AUG-14 Saturday
    10-AUG-14 Sunday
    11-AUG-14 Monday
    12-AUG-14 Tuesday
    13-AUG-14 Wednesday
    14-AUG-14 Thursday
    15-AUG-14 Friday
    16-AUG-14 Saturday
    17-AUG-14 Sunday
    18-AUG-14 Monday
    19-AUG-14 Tuesday
    20-AUG-14 Wednesday
    21-AUG-14 Thursday
    22-AUG-14 Friday
    23-AUG-14 Saturday
    24-AUG-14 Sunday
    25-AUG-14 Monday
    26-AUG-14 Tuesday
    27-AUG-14 Wednesday
    28-AUG-14 Thursday
    29-AUG-14 Friday
    30-AUG-14 Saturday
    31-AUG-14 Sunday
    01-SEP-14 Monday
    02-SEP-14 Tuesday
    03-SEP-14 Wednesday
    04-SEP-14 Thursday
    05-SEP-14 Friday
    06-SEP-14 Saturday
    07-SEP-14 Sunday
    08-SEP-14 Monday
    09-SEP-14 Tuesday
    10-SEP-14 Wednesday
    11-SEP-14 Thursday
    12-SEP-14 Friday
    13-SEP-14 Saturday
    14-SEP-14 Sunday
    15-SEP-14 Monday
    16-SEP-14 Tuesday
    17-SEP-14 Wednesday
    18-SEP-14 Thursday
    19-SEP-14 Friday
    20-SEP-14 Saturday
    
    46 rows selected.
    
    SQL>
    
  • PPR report, how to display the label with TOTAl

    Hello


    How can I view PPR report, how the display label with as TOTAl

    [http://apex.oracle.com/pls/apex/f?p=267:30:]


    Thank you

    Published by: 805629 January 6, 2011 03:34

    Hello

    Report RPP:

    Select 'Yes' to the point 'Enable partial Refresh of Page' region 'Layout and Pagination' report of the attributes of this report.

    For the display Label with TOTAL:

    Use 'Break the formatting' region in relation to the attributes of this report.

    Kind regards

    Patel Kartik
    ------------------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • Problem with query to find data offset

    Hello PL/SQL gurus and Experts.

    I am not able to extract the data with the following table structure-
    drop table T2;
    create table T2(Stream, Trade, Fees) as select
    'MECHNICAL', 'Primary', '5534500' from dual union all select
    'ELECTRICAL', 'Secondary', '5285500' from DUAL union all select
    'MECHNICAL', 'Secondary', '2364535' from dual union all select
    'ELECTRICAL', 'Primary', '1734540' from DUAL union all select
    'MBE', 'Secondary', '3424500' from dual union all select
    'ELECTRONICS', 'Primary', '5004567' from DUAL union all select
    'ELECTRONICS', 'Secondary', '4543200' from DUAL union all select
    'COMPUTERS', 'Secondary', '5534500' from DUAL union all select
    'CIVIL', 'Primary', '2345500' from DUAL union all select
    'CIVIL', 'Secondary', '4456500' from DUAL union all select
    'COMPUTERS', 'Primary', '9542500' from DUAL;
    I want to extract the data in the following format-
    Stream          Trade          Fees
    MECHNICAL     Primary          5534500
              Secondary          2364535
    ELECTRICAL     Primary          1734540
              Secondary       5285500
    ELECTRONICS     Primary          5004567
              Secondary        4543200
    CIVIL          Primary          2345500
              Secondary         4456500
    MBE          Primary     
              Secondary       3424500
    Total                    34693342
    Now if I use the following query-
    SELECT CASE WHEN LAG(Stream||Trade) OVER (ORDER BY Stream, Trade, Fees) = Stream||Trade THEN NULL ELSE Stream END Stream
         , CASE WHEN LAG(Stream||Trade) OVER (ORDER BY Stream, Trade, Fees) = Stream||Trade THEN NULL ELSE Trade END Trade
         , CASE WHEN LAG(Fees) OVER (partition by Stream||Trade ORDER BY Stream, Trade, Fees) = Fees THEN NULL ELSE Fees END Fees
    FROM (     select distinct Stream, Trade, Fees from T2 ORDER BY Stream, Trade, Fees);
    SELECT  NVL2(LAG(Trade) OVER (PARTITION BY Stream, Trade ORDER BY Stream, Trade, Fees),Null,Trade) Trade,
         NVL2(LAG(Stream) OVER (PARTITION BY Stream, Trade ORDER BY Stream, Trade, Fees),Null,Stream) Stream,
         Fees
    from (select distinct Stream, Trade, Fees from T2)
    Kindly help me...
    Thank you all for your time and effort in advance.

    use the below. There would be better ways to achieve, I find it easier.

    with filtered as
    (
      select case row_number() over(partition by stream order by trade)
              when 1 then stream
              else null end stream2,trade,fees
      from t2
      order by stream,trade
    )
    select stream2 stream, trade, to_number(fees)
      from filtered
    union all
    select 'Total', null, sum(fees)
      from t2;
    
    STREAM      TRADE     TO_NUMBER(FEES)
    ----------- --------- ----------------------
    CIVIL       Primary   2345500
                Secondary 4456500
    COMPUTERS   Primary   9542500
                Secondary 5534500
    ELECTRICAL  Primary   1734540
                Secondary 5285500
    ELECTRONICS Primary   5004567
                Secondary 4543200
    MBE         Secondary 3424500
    MECHNICAL   Primary   5534500
                Secondary 2364535
    Total                 49770342     
    

    I hope that it meets your needs. If this isn't the case, then please don't forget to provide the expected results, because we have to guess, if you still want to exit expected Original or there is a diversion in it.

  • How always display the date with taskbar buttons activated in widows 8?

    It's got to be average, just to be there. Even using the buttons small taskbar, it is actually enough space to have always the date and stacked. I would be well with them, next to each other also. I don't really understand why the date masks even as it would fit really well. I'm fine with the help of a third party program if necessary. I already have the classic interface installed because microsoft somehow forgot to add the menu start Windows 8.

    There are several strange suggestions and wonderful here for you to play with.  Make sure that you first create a system restore point.

    Windows 7 - display date using small icons
    http://superuser.com/questions/89628/Windows-7-display-date-using-small-icons

    http://www.Google.com.au/search?q=use+small+taskbar+but+have+date+and+time&SourceID=IE7&RLS=com.Microsoft:-to THE: IE-address & ie = & oe = & gws_rd = cr & redir_esc = & ei = 4L7sUaPiKKWSiQe2_IFQ

  • Script of VM inventory for VM name with the location, the name of the Cluster and data storing total size and free space left in DS.

    Hello

    I wanted to collect script inventory VM VM name with location, name of the Cluster and data store total size and free space left in Datastore.I have script but his mistake of shows during its execution. Any help on this will be apreciated.

    Thank you

    VMG

    Error: -.

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:7 tank: 20
    + $esx = get-view < < < < $vm. Runtime.Host - name of the Parent property
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:8 tank: 24
    + $cluster = get-view < < < < $esx. Parent - the name of the property
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null or empty. Provide an argument that is not null or empty, and then try
    the command again.
    E:\script\VM-DS-cluster.ps1:9 tank: 24
    + += get-view $report < < < < $vm. Store data-name of the property, summary |
    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)
    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    It seems that your copy/paste lost some.

    I have attached the script

  • Problem in display detail with aggregated data.

    Hello

    I'm new on the BEEP and I am facing problem to see the detail, but also the aggregated both values.

    My details are as below

    Value of a security
    S1 10
    S2 20
    S3 30
    S3 40
    S4 50
    S5 60
    S5 70

    I want to display data in the report
    Value of a security
    S1 10
    S2 20
    S3 30
    S3 40
    S3 70 total
    S4 50
    S5 10
    S5 70
    Total 80 S5


    I tried to use to <? for-each-group: G_2; / Security? > but I get after release:
    Value of a security
    S1 10
    S2 20
    S3 30
    S3 70 total
    S4 50
    S5 10
    Total 80 S5

    Model:
    <? for-each-group: G_2; / Security? > <? Security? >: <? Value? >
    <? If: count (current - group (/SECNAME)) > 1? > Total <? Security? >: <? sum (current - group (/Value))? > <? end if? > <? end for each group -? >

    The problem is that I need to view the details as well as aggregated data. Please suggest.

    Instead of G1, use G_1.

    Since you are using 11g, you can also try this code:

    :
    1? > total :

  • Display different data with CSV

    Hello

    How can I build a query to separate the data with csv, but show me only the distinct records

    SQL>  SELECT t1.cd_usuario||','||t1.cd_usuario_cc usuarios
      2    FROM sibtb_usuario_email t1;
     
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    upisergi,udoaldir,ubaemers
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    ukagisle,udoaldir
    usisheil,ureanacl,usomaris
    ureanacl,
    usisheil,udoaldir,ujuhelio,ujujulio,ufinilo
    I woudld like show only, each record in each line
        ukagisle
        udoaldir
        upisergi
        ukagisle
        usisheil
        ureanacl
        usomaris
        ujuhelio
        ujujulio
        ufinilo
       
    Is it possible to do so, by using ORACLE 9.2.02

    TIA

    Like this?

    With T as(
    SELECT distinct t1.cd_usuario||','||t1.cd_usuario_cc||',' usuarios
    FROM sibtb_usuario_email t1
    )
    select distinct usuarios from (
         select
         case when no=1 then
              substr(usuarios, 1,instr(usuarios,',')-1)
         else
              substr(usuarios,instr(usuarios,',',1,no-1)+1,(instr(usuarios,',',1,no)-instr(usuarios,',',1,no-1))-1)
         end usuarios
         from t
         cross join
         (
              select level no
              from (select max((length(usuarios)-length(replace(usuarios,',')))+1) len from t)
              connect by level <= len
         )
    )
    where trim(usuarios) is not null
    /
    
    USUARIOS
    ---------------------------------------------
    usisheil
    ujujulio
    upisergi
    udoaldir
    ureanacl
    ukagisle
    ubaemers
    usomaris
    ujuhelio
    ufinilo
    
    10 rows selected.
    
    Elapsed: 00:00:00.07
    

    HTH,
    Prazy

    Published by: Prazy on April 28, 2010 18:33
    In SQL format... Looked clumsy *.<>

  • Display of data in Total

    Hello

    I am facing a problem, we have created new accounts to display currency data. STAT data is loaded to the cost center level.
    When we create the report on these accounts, I see displaying data as a total for all cost centers. I need data be displayed by each company centre and the cost.

    There is another account that appear as a detail.

    Please help me to know why these accounts appear as TOTAL.

    Any help is greatly appreciated.

    Thank you
    Poojak

    Hello

    Yes, you need to change in the responses.

    For this column value formula SUM (amount of Transaction by company, Costcenter)

    Thank you
    Vino

  • Sort data with display each trip

    HY,

    I need a VI witch sorts data with 2 aray.

    In this image, I first aray after sorting, the first column is position of cd rack and second column is the number of cd.

    To sort, I use position 6 in rack, this position is free.

    To this picture of the situation as:

    1-6

    3 1

    5 3

    4-5

    2-4

    6 1

    These are the movements that you do... I need a VI that makes it.

    EX:

    Good day.


Maybe you are looking for