Select lines having sum (col) = & val - a time line = & val or combination

Dear all

I have following ABC table with two columns. I need to return the rows having vlue against given parameter, weather it is a single line or combination of lines MySQL is the default setting, but must return all the participating lines:

Value name

20 Coke
drink 80
Pepsi 100
Mirinda 380
250 juice
Orange 500
lemon 880

----
Now, I want to next result: if I pass the value = 100 query must return

Pepsi 100 Row1
Row2, 3 (coke20 + drink80) = 100

If I pass the value = 880 then

Row1 lemon 880
row2, 3 (orange 500, mirinda 380) = 880

--
Please let me know how I can solve this query select Thur or a need for function/procedure for this return lines.

Respect of

Hassan

user9206270 wrote:
If I pass the value = 100 and there in the table to a single point with line (juiceabc) have value = 50, then it also returns
as:

juiceabc juiceabc 100

Use it instead.

With T As (
select 'coke' Item ,20 Amount from dual union all
select 'drink',80 from dual union all
select 'pepsi',100 from dual union all
select 'mirinda',380 from dual union all
select 'juice',250 from dual union all
select 'orange',500 from dual union all
select 'lemon',880 from dual union all
select 'juiceabc',50 from dual
),
--
--End of sample data
--
T_new as (select item,amount from T union all
select ' ',0 from dual )
select a_item,b_item,sum_amount
from (select distinct greatest(a.item,b.item) a_item,least(a.item,b.item) b_item,a.amount+b.amount sum_amount from T_new a,T_new b order by 1)
where
sum_amount=&amt
and (trim(a_item) is not null or trim(b_item) is not null)
and a_item != b_item
order by a_item,b_item
/

PRAZY@11gR1> /
Enter value for amt: 100
old  19: sum_amount=&amt
new  19: sum_amount=100

A_ITEM   B_ITEM   SUM_AMOUNT
-------- -------- ----------
drink    coke            100
pepsi                    100

Elapsed: 00:00:00.07
PRAZY@11gR1> /
Enter value for amt: 50
old  19: sum_amount=&amt
new  19: sum_amount=50

A_ITEM   B_ITEM   SUM_AMOUNT
-------- -------- ----------
juiceabc                  50

Elapsed: 00:00:00.07

Also if there are three elements with the value of 30, 50, 20 = 100 (matches with my brush i.e. 100 parameter) can then return to the query as:

juicecd juiceef juicegh 100

You do a cross join. and most importantly you will end - up in cross joins n where n is the number of rows in your table.

HTH,
Prazy

Tags: Database

Similar Questions

  • How to highlight the selected line in an interactive report in apex5?

    Hello

    I want to emphasize the selected line in the report by changing the background color of the line. Basically, I want to do this. I really want to do is, select a row in the report and according to the selected line, I want to retrieve other data to another interactive report on the same page. So, how can I do this?

    Hi geslin,.

    Garza says:

    But here shows a link to another page or something like that. But I don't need that. I just want to show when the user selects a specific row by clicking on this line, and it should show that it has been selected by changing the color of the line and after having extracted a few hidden field and according to those column data display data on another report on the same page.

    Check your Application-> Page 2 30870. I've set up a dynamic action to reach the line highlighted when selected.

    Here are the steps to achieve the highlighted line:

    • Changed the definition of class employee culminating point to CSS-> section of the line on the page:
    .highlight-employee
       {
        background-color: blue !important;
        color: white !important;
       }
    
    • Commented the code written in JavaScript-> Execute JS when the section of the page to load the page.
    • Edited the ROWID of your interactive report column and set the following properties for 'column link:

    Text link: #ROWID #.

    Link attributes: id = "" #ROWID # "class ="monlien""

    Target: URL

    URL: javascript:void (0);

    • Dynamic action created with the following properties:

    Name: highlight_selected_row

    Event: click on

    Selection type: jQuery Selector

    jQuery Selector: a.mylink

    Action: Run the JavaScript Code

    Fire on loading the Page: No.

    Code:

    var row_id = this.triggeringElement.id;
    $('#P2_NEW').val(row_id);
    $('#'+row_id).parent().closest('tr').find('td').addClass('highlight-employee');
    

    Scope of the event: Dynamics

    Kind regards

    Kiran

  • I'm opening table row in a popup with the help of change. If I opened a line to edit, and then if I cancel the popup and if I open some row of the table, then instead of the newly selected line diff, previously selected line becomes open question. Help, p

    @Code is:-

    I have a panelCollection which is having an ADFTable (VO) and < f: toolbar > < coomandToolbarbutton > IE change by clicking on modify the selected line of the tbal adf becomes open in edit mode in a popup. Buttong ActionListner change creation popup

    {} public void handleEdit (ActionEvent actionEvent)
    Add the code in the event here...

    Line selectedRow =
    (Row) ADFUtils.evaluateEL ("#{bindings.") BtEsAwardsSchemeSetupVO1Iterator.currentRow}");
    Line selectedRow =
    (Row) ADFUtils.evaluateEL ("#{bindings.") BtEsAwardsSchemeSetupVO1.currentRow}");

    Tips RichPopup.PopupHints = new RichPopup.PopupHints ();

    this.getAddEditpopup () .show (hints);
    }

    Pupup has two buttons for Submit and cancel.
    Click on Cancel button on the popup, it id hide. The question is, suppose that the table is to have 4 lines so if I first select third row and click on change that becomes open editing on a popUp, but if I click on the Cancel button and their selection a few rows of table (Say first line), the previously selected (3rd row) rank only becomes open again in popup instead of the newly selected row.
    Cacel code

    {} public void handleCancelAwards (ActionEvent actionEvent)

    Add the code in the event here...

    ADFUtils.invokeEL ("#{bindings.") Rollback.Execute}");

    this.getAddEditpopup (.cancel ()); [I also tried with hide and seek but not worked]

    }

    Thanks in advance and thanks for your time

    It may be a problem with the combination of: immediate = true, rollback, and af:popup.

    You can try adding af:resetActionListener to the Cancel button.

    BTW, your managed bean is in the package that start with uppercase ("Bean"). (if you should refactor this to "beans" (for example))

    Dario

  • Need help to select lines

    I have a scenraio like that

    Amt1 amt2 amt3 Bank
    BOA 100 0 0
    CHASE 0 200 100
    CITI 0 0 0
    CHEVY 0 0 0
    MERRILL 0 100 0
    SBH 0 0 0
    SBI 500 0 0
    NGC 0 100 0
    NTBC 600 0 0
    ICICI 700 100 0

    I need to select lines leaving the lines are nil
    as citi and chevy that has all 0 (amt1, amt2, amt3)... the result set should not receive these 2 rows


    I tried like Jules Destrooper

    Select * from Bank_details
    where > 0-> 0-> 0 amt3 amt2 amt1

    but above query gives 0 rows... can help a whole in this

    Hello

    Of course, you can do it.

    If amt is always an integer, you will find way to easier Sean:

    HAVING    SUM (amt1)  BETWEEN 101 AND 499
    AND       SUM (amt2)  BETWEEN 101 AND 499
    

    However if amt1 may have values such as 100.01, you do this way:

    HAVING    (   SUM (amt1) > 100
              AND SUM (amt1) < 500
              )
    OR        (   SUM (amt2) > 100
              AND SUM (amt2) < 500
              )
    

    When you use both AND and OR, make sure you're only using one or the other at the same level.
    For example, never say:

    HAVING    SUM (amt1) > 100
    AND       SUM (amt1) < 500
    OR        SUM (amt2) > 100  -- NO! Don't do this!  Asking for trouble!
    
  • ObjectListField change selected line color

    The default selected line is blue, is it possible to change this?  I tried

    graphics.setBackgroundColor (Color.LIGHTGREY);

    Which changes not the background, but I don't see how to change the color of the selected line.

    This is the skeleton of the class we use trying to hightlight the target ourselves line:

    private class XXXXListField extends {ListField
    Special list field designed to ensure that the field gets updated when the focus moves
    This is necessary because we try to display lines of development of the background colors.
    Private boolean _inFocus = false;
    public XXXXListField() {}
    Super();
    }

    public int moveFocus (amount int, int status, time int) {}
    This.Invalidate (getSelectedIndex ());
    Return super.moveFocus (amount, status, time);
    }

    Called when the field receives focus.
    {} public void onFocus (int direction)
    hasFocus = true;
    _inFocus = true;
    super.onFocus (branch);
    }

    Called when a field loses focus.
    public void onUnfocus() {}
    hasFocus = false;
    _inFocus = false;
    super.onUnfocus ();
    This.Invalidate (getSelectedIndex ());
    }

    public boolean isFocus() {}
    Return _inFocus;
    }

    }

  • Updated all the selected lines in a table.

    Hello

    Jdev Version 11.1.2.3.0

    I'm trying to update all the selected rows in a table with several choices.

            AppModuleImpl am = (AppModuleImpl)ADFUtils.getApplicationModuleForDataControl("AppModuleDataControl");
            ViewObject vo = am.findViewObject("RegistrationHistory1");
            RowKeySet selectedRegistrations = historyTable.getSelectedRowKeys();
    
    
            if (selectedRegistrations != null) {
                Iterator iter = selectedRegistrations.iterator();
                    while (iter.hasNext()) {
                        Object facesTreeRowKey = iter.next();
                        Row[] row = vo.findByKey((Key)((List)(facesTreeRowKey)).get(0), 1);
    
    
                        if (row != null && row.length == 1) {
                            Row r = row[0];
                             r.setAttribute("Attr", "1"); 
                        }
                    }
              }
    

    But after I put the attribute on the line. My iterator ignores most of the lines and they don't last updated.

    It works very well for the removal of the line well.

    Any suggestions?

    It turn out that I got a try catch and in the catch, I had a log (e.printStackTrace ()) and I do not see a single line in the diary saying ConcurrentModificationException appearing all the time.

    Looks for read-only access to an attribute or delete lines is OK to iterate over the selected lines, but it's different for the modification of an attribute.

    The code that worked:

    Links DCBindingContainer = (DCBindingContainer) BindingContext.getCurrent () .getCurrentBindingsEntry ();

    Entry DCIteratorBinding = bindings.findIteratorBinding ("RegistrationHistory1Iterator");

    RowSetIterator regRSiter = regIter.getRowSetIterator ();

    RowKeySet selectedRegistrations = historyTable.getSelectedRowKeys ();

    Object [] keys = selectedRegistrations.toArray ();

    for (Object key: keys) {}

    Line currentRow = regRSiter.getRow ((Key) ((List) key) .get (0));

    removeOrModify (currentRow);

    }

  • Select line if found, otherwise select between rows

    Oracle 11.2.0.1

    Windows

    create table test (col1 number);

    Insert test values (10957);

    Insert test values (10958);

    Insert test values (10959);

    Insert test values (10960);

    Insert test values (10972);

    Insert test values (10973);

    Insert test values (10980);

    Insert test values (10982);

    SQL > select * from test where myfunct (10960) = true;

    COL1

    ----------

    10960

    If I said value 10962 then output should be these lines that comes between the values.

    SQL > select * from test where myfunct (10962) = true;

    COL1

    ----------

    10960 <-10960 min is closest to 10962

    10972 <-10972 max is the closer of 10692

    even similar;

    SQL > select * from test where myfunct (10981) = true;

    COL1

    ----------

    10980

    10982

    If I select which is out of reach of min/max all the then only I should get any selected lines.

    SQL > select * from test where myfunct (10983) = true;

    or

    SQL > select * from test where myfunct (10956) = true;

    no selected line

    I have no idea how to choose this line if col1 = given, otherwise the lines min/max who comes between the two given the value and no line if the given value is min/max in the col1 values.

    Kindly help me.

    Thank you.

    Always use the SQL because SQL purse always faster than anything. But if you want to get the result by running the function you can create pipelined function.

    SQL > CREATE or REPLACE TYPE obj_testCol1 AS OBJECT (collar number);

    2.

    Creative type

    SQL > CREATE or REPLACE TYPE obj_testCol1_table IS TABLE OF THE obj_testCol1;

    2.

    Creative type

    SQL >

    SQL > CREATE or REPLACE function MyPF (n number)

    2 return obj_testCol1_table

    3 PIPELINED is type t_ref_cursor IS REF CURSOR;

    4

    t_ref_cursor rf_c 5;

    6 r_out_rec obj_testCol1: = obj_testCol1 (null);

    7. start

    8

    9. open rf_c for

    10

    11. Select col1

    12 years of test

    13 where col1 = n

    14 union of all the

    15 select col1

    16 from (select *)

    17 in (select row_number() over (partition by sign (col1 - n) order to decode (sign (col1 - n),-1, abs (col1 - n), col1 - n)) r,)

    18 max (col1) over() mx.

    19 min (col1) over() minutes.,

    20                             col1

    21 test

    22 where does not exist (select 1 test where col1 = n))

    where the 23 mx > = to_number (n)

    24 and mn<=>

    25 where r = 1;

    26

    27 LOOP

    28 rf_c FETCH

    29 IN r_out_rec.col;

    30

    EXIT 31 WHEN rf_c % NOTFOUND;

    PIPE 32 ROW (r_out_rec);

    33 END LOOP;

    34

    35 CLOSE rf_c;

    36 end;

    37.

    Feature created

    SQL > select * from table (MyPF (10960));

    COL

    ----------

    10960

    SQL > select * from table (MyPF (10962));

    COL

    ----------

    10960

    10972

    SQL > select * from table (MyPF (10983));

    COL

    ----------

    SQL >

    ----

    Ramin Hashimzade

  • How to make the selection line more dark?

    It's my first time to use Photoshop CC, however, it is very difficult for me to see the selection line when I use "selection tool" to select an area, it is possible to adjust the darker line?

    Currently, I don't know of a way. However, I recommend that you post a suggestion on what makes the color and thickness of the pieces in the suggestion of photoshop forum.

    Community customer Photoshop family

  • EL for obtaining a value of selected line

    Hello experts!

    I have a page with a table of users and I implement a button named "Reset the user password".

    I want to display a popup with a title: "reset password for user: xxxx", where xxx is to be obtained by EL referring to the current user selected in the users table.

    Any idea? I use jdev 12.1.2

    Thank you!

    I found the solution in the book Jobinesh-Oracle that I bought a long time ago! (Thanks!)

    Declaratively reading the value of the attribute of the currently selected line

    It is very common that when a line is selected in a table, you can update

    other fields in the user interface or call some specific operations with attributes of the selected

    line. There is an easy way to retrieve the attributes you want for the current of line

    definition of the attribute for the attribute binding.

    To set the attribute binding, do the following:

    1. double-click on the file page definition to open the presentation Editor.

    Alternatively, if you have the JSF page opened in the designer

    window, and then by selecting the links tab will open the corresponding

    page definition file editor.

    2. Select the links and the executable tab and click the Green plus icon to

    create a control's binding icon that will be displayed on the bindings panel.

    3. in the dialog window insert an element, select the generic category of links (if it)

    is not selected by default) in the menu drop down and select attribute values

    as the point to be created. Click OK to proceed to the next step. In the

    Create the attribute Binding dialog box, select the desired data source

    (instance of the view object) and then the attribute you want to read

    the line selected in the data source. Click OK to have the dialog box.

    The following is an example for a binding attribute value defined by choosing the

    Collection Departments as data source:

    It's in the page definition XML file

    ID = "DepartmentName" >

    Once you have defined the attribute bindings, you can refer to them using the

    EL of the client binding expression. For example, the value of the previous attribute

    reference can be made using the expression of ADF link as follows:

    #{bindings. DepartmentName.inputValue}

  • How get the sum of differences in time

    I have the query to get the taken (duration) of time to perform each activity below


    Select (select ep.name PE env_mapping where ep.id = p.bsa_env_id) environment,
    (Select trunc ((Max (ps.actual_end) - Min (ps.actual_start)) * 24 * 60) of ps Highlevel_activity where ps.activity_ID = p.id and ps.out_of_window_flag =' no. "") Actual_duration,
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Apps Patching"and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Apps_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, Highlevel_activity ps where de.task_type = ' Patching DB/MT ' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') DB_MT_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Shut Down' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Shut_Down,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Start Up' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Start_Up,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Vérification' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = 'NO') audit.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Patching meadow' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Pre_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Patching Post' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Post_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Others' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = 'NO') others

    activity p where

    I get the output as below

    EnV1 27 April 13 167 54 29 29 15 0 0 67 0
    EnV2 may 3 13 10 20 05 05 0 0 50 0 33


    My requirement is to get the amount for each column which I get on top of the query. How can I change the query above to get as the result below


    EnV1 27 April 13 167 54 29 29 15 0 0 67 0
    EnV2 may 3 13 10 20 05 05 0 0 50 0 33
    177 74 34 34 15 50 67 33 total

    Please help

    Thank you
    Archana

    Hello

    Agowda wrote:
    I have the query to get the taken (duration) of time to perform each activity below

    Select (select ep.name PE env_mapping where ep.id = p.bsa_env_id) environment,
    (Select trunc ((Max (ps.actual_end) - Min (ps.actual_start)) * 24 * 60) of ps Highlevel_activity where ps.activity_ID = p.id and ps.out_of_window_flag =' no. "") Actual_duration,
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Apps Patching"and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Apps_Patching,.


    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, Highlevel_activity ps where de.task_type = ' Patching DB/MT ' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') DB_MT_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Shut Down' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Shut_Down,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Start Up' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Start_Up,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Vérification' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = 'NO') audit.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Patching meadow' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Pre_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Patching Post' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = ' NO') Post_Patching,.
    (select nvl (trunc ((max (de.actual_end) - min (de.actual_start)) * 24 * 60), '0') Detail_activity time_taken, ps Highlevel_activity where de.task_type = 'Others' and ps.activity_id = p.id and.) Highlevel_activity_id = ps.id and ps. OUT_OF_WINDOW_FLAG = 'NO') others

    activity p where

    If you make 9 of subqueries to get 9 different columns. It is very inefficient, and it is also difficult to maintain. If you need to change the conditions in subqueries, you will need to do the exact same change at 9 different locations.
    It would be much more effective if you just add de.task_type to the GROUP BY clause and then rotates the results. He could not run 9 times faster, but it probably run 5 times faster.
    See the FAQ forum {message identifier: = 9360005} to find out how.

    I get the output as below

    EnV1 27 April 13 167 54 29 29 15 0 0 67 0
    EnV2 may 3 13 10 20 05 05 0 0 50 0 33

    My requirement is to get the amount for each column which I get on top of the query. How can I change the query above to get as the result below

    EnV1 27 April 13 167 54 29 29 15 0 0 67 0
    EnV2 may 3 13 10 20 05 05 0 0 50 0 33
    177 74 34 34 15 50 67 33 total

    It's a GROUPING DEFINED work, no ACCUMULATION.

    Since you post CREATE TABLE and INSERT statemennts for your sample data, I will use the hr.departments table to show the difference.
    When you GROUP BY N > 1 the expressions, ROLLUP gives you N + 1 levels of totals and subtotals. For example:

    SELECT       department_id
    ,       job_id
    ,       SUM (salary)     AS total_sal
    FROM       hr.employees
    GROUP BY  ROLLUP (department_id, job_id)
    ORDER BY  department_id, job_id
    ;
    

    The above query GROUPs BY s expressions (department_id job_id) so ROLLUP produces 3 sorts of totals:
    (1) total department_id and job_id (e.g. 13000 for department_id = 20 and job_id = "Fatyty" below)
    (2) total Department, including all of the work (e.g. 6000 = 19000 13000 + for department_id = 20) and
    (3) total general for the entire result (e.g. 691416)

    DEPARTMENT_ID JOB_ID      TOTAL_SAL
    ------------- ---------- ----------
               10 AD_ASST          4400
               10                  4400
               20 MK_MAN          13000
               20 MK_REP           6000
               20                 19000
               30 PU_CLERK        13900
               30 PU_MAN          11000
               30                 24900
               40 HR_REP           6500
               40                  6500
               50 SH_CLERK        64300
               50 ST_CLERK        55700
               50 ST_MAN          36400
               50                156400
               60 IT_PROG         28800
               60                 28800
               70 PR_REP          10000
               70                 10000
               80 SA_MAN          61000
               80 SA_REP         243500
               80                304500
               90 AD_PRES         24000
               90 AD_VP           34000
               90                 58000
              100 FI_ACCOUNT      39600
              100 FI_MGR          12008
              100                 51608
              110 AC_ACCOUNT       8300
              110 AC_MGR          12008
              110                 20308
                  SA_REP           7000
                                   7000
                                 691416
    

    You don't want all that: you just want what corresponds in total for each department_id and job_id and total general, without any level of iintermediate. Here's how you can achieve these results using GROUPING SETS instead of ROLLUP:

    SELECT       department_id
    ,       job_id
    ,       SUM (salary)     AS total_sal
    FROM       hr.employees
    GROUP BY  GROUPING SETS ( (department_id, job_id)
                   , ()
                   )
    ORDER BY  department_id, job_id
    ;
    
    DEPARTMENT_ID JOB_ID      TOTAL_SAL
    ------------- ---------- ----------
               10 AD_ASST          4400
               20 MK_MAN          13000
               20 MK_REP           6000
               30 PU_CLERK        13900
               30 PU_MAN          11000
               40 HR_REP           6500
               50 SH_CLERK        64300
               50 ST_CLERK        55700
               50 ST_MAN          36400
               60 IT_PROG         28800
               70 PR_REP          10000
               80 SA_MAN          61000
               80 SA_REP         243500
               90 AD_PRES         24000
               90 AD_VP           34000
              100 FI_ACCOUNT      39600
              100 FI_MGR          12008
              110 AC_ACCOUNT       8300
              110 AC_MGR          12008
                  SA_REP           7000
                                 691416
    

    I hope that answers your question.
    If this isn't the case, post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data.
    Simplify the problem. For example, instead of 9 different task_types, post sample data and results for 3 task_types. Simply mention that you actually 9, and we will find a solution that can be easily adapted for 9.
    Always say what version of Oracle you are using (for example, 11.2.0.2.0).
    See the FAQ forum {message identifier: = 9360002}

    Published by: Frank Kulash on May 27, 2013 10:47

  • Getting a value from all the selected lines in the method of the AM

    Hi all

    I use JDev 11.1.1.4.0

    I have a table with the selection of several lines. In my module application I want to call a stored procedure with the parameter whose value depends on the selected line in the table.
    For the only selection I can make fallow:
        public void wypiszId() {
            ViewObject vo = findViewObject("ProcsklView1");
            String st = vo.getCurrentRow().getAttribute("IdProcskl").toString();
            System.out.println(st);
    How can I deal with multiple selection?

    Kind regards
    Wojtek.

    Hello

    VO/iterator will hold only selected line at a time. Thus, for multi table enabled selection, the last selected line would be the selected line (vo / Iterator). In order to obtain all the selected lines, you must obtain support bean by linking the Table of the ADF.

    Check out this blog on this goal.

    http://blogs.Oracle.com/aramamoo/2010/12/getting_all_selected_rows_in_adf_table_with_multiple_rows_selection_enabled.html

    Arun-

  • To select lines within a clipping mask

    Hello

    I don't know if anyone else has had this problem but I just upgraded to CS4 and I'm having a few problems in illustrator.

    I have an illustration of a shirt where the collar and cuffs are illustrated by a good number of lines that are sitting inside a clipping mask to illustrate the ribs.

    I used to be able to individually select each of these lines when using CS3, but now that I'm on CS4, it won't let me do that, it will not literally select lines.  I was wondering if something changed regarding clipping paths in the upgrade as if I take off the same file in CS3, it works perfectly?

    If someone else has had a similar problem and found a solution I would appreciate any help you could give me!

    Maybe because you started using CS4 without having read enough about the changes?

    Masks in CS4 work differently because users like you and me were not satisfied with the visibility of the content beyond the mask mask (but you probably knew that).

    So now objects outside of the mask are not visible and not get calculated when you align, transform or even manipulate the mask + object.

    One of the consequences is that you can't seize objects beyond the mask in traditional methods. He worked 'perfectly' in CS3, but not in CS4 because the application has changed.

    Try to go through the contour mode and enter endpoints beyond the mask with the lasso tool.

  • Get the "selected lines" value after sql custom query in the database adapter

    We execute a custom query in a database adapter. With other technologies (JDBC, etc.) the result of a query produces not only a game but the number of lines selected results. For example, the output of the script of Oracle SQL Developer will display something like:

    9999 selected lines

    at the end of the output of the script.

    I would like to obtain this value for a BPEL process. Of course, I could run a 2nd interview whose where clause is identical to the first, but select count (*) instead. However, it is not only ineffective but (in rare circumstances in an active database) could be the problem.

    It is not obvious to the novice BPEL how to get the selected value and the result set row in an Invoke. Is this possible?

    Maybe it's not the only solution - but this is how I did in the past.

    After step to invoke the adapter, use a step of the having-right/copy to fill a variable of integer type BPEL using the xpath count function...






    That should affect the number of records returned by the query.

    I hope this helps.

    Rod.

    Published by: Tunnels of Rod on December 15, 2009 13:16

  • definition of particular column of all selected lines of Viewobject in MB

    I have two Radio buttons: one is for real and a fake.
    I have the button.
    I Table.I have the ability to select several rows at a time.
    One of the column in the table is only to be set to 'True' or 'False'. This column, I did as false and true containg LOV.

    When the user selects lines (more than one may also able to choose) in the table and select the 'real' radio button and click on the button right now I need to set the value LOV 'true' in all lines.
    If he select the 'false' radio button, this time value LOV should set to false.

    So is my requirement.

    Inside of the Managed bean, how can I set the particular column of all the rows selected in Viewobject.

    If anyone has the code for this please give me.

    Sanchez

    Hi Catherine,

    You can browse the selected table lines, get the key from the line, find the line in the view object using the key of this line and appropriate attribute set to false or true:

            DCBindingContainer dc = (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
            DCIteratorBinding iter = dc.findIteratorBinding("");
            ViewObject vo = iter.getViewObject();
            Transaction trans = vo.getApplicationModule().getTransaction();
    
            RowKeySet rks = table1.getSelectedRowKeys();
            Iterator rksIter = rks.iterator();
            while (rksIter.hasNext()) {
                List l = (List) rksIter.next();
                Key key = (Key)l.get(0);
                //System.out.println(key);
               Row row = vo.getRow(Key);
               row.setAttribute("", );
            }
    
            trans.commit();
    

    where af:table is bound to table1 in managed bean

    Kind regards

    Branislav

  • How can I save text that I use regularly in the emails to avoid having to retype it every time?

    How can I save text that I use regularly in the emails to avoid having to retype it every time?

    Try this add-on: https://addons.mozilla.org/en-US/thunderbird/addon/clippings/

    http://chrisramsden.vfast.co.UK/3_How_to_install_Add-ons_in_Thunderbird.html

Maybe you are looking for

  • Sync connection window is empty

    HelloI have problems to log in to the Firefox sync process. After the update, I have a yellow line at the bottom of the browser window that indicates that there is a synchronization problem, and that the password is not valid. After pressing the 'Pré

  • Need a new fan of cooling to Satellite P300

    I have Toshiba Satellite P300 model PSPC4E-02E00JG3 numb. I have problem with my fan, makes funny noise. I think buying a new one, because after I cleaned it, it still produced noise. Is could someone please tell me what is the price of the cooler?

  • Need new processor for Hp Pavilion p6000 series

    Hey everyone I broke one of the most important commandments of the computer world."You won't be bending your pins of the processor.Well Yes, I bent and broken irreparably pins at the bottom of my CPU and now I need a new. I cannot know what is and is

  • If I entered my wps pin # on someone elses inorder to laptop for them to access the internet don't I put my computer in jepardy

    I did this to help neighbor his computer up to date, don't think not that it is in the apt.next mine and I know not just that he lives there did I screw up? I think that he now has access to my card and internet service, I care about as lonely as it

  • netsvcs svchost.exe using too much speed processor - Windows 7

    Hello My laptop that runs windows 7 works very slowly if at all during startup or even to open programs. I open the Task Manager > performance > resource monitor and find svchost netsvcs uses more than 90% of the CPU. I found by suspending the proces