to get the total value as application even if item_number is added

Hi all

I have the following query with me
SELECT   SUM (  (NVL (f.calc_cement_sk, f.calc_amount) * NVL (f.item_price, 0)
                )
              - (  NVL (f.calc_cement_sk, f.calc_amount)
                 * NVL (f.item_price, 0)
                 * (NVL (f.dis_per, 0) / 100)
                )
             ) total,
         h.slurry_type, h.stage_id, h.slurry_vol_actual
    FROM xxnp_opn_joblog_est_002 f,
         xxnp_opn_joblog_001 j,
         xxnp_opn_joblog_slurry_003 h,
         qp_secu_list_headers_v qw
   WHERE j.opn_job_desc = 'K/D/KD43/UG187/1338/D/0211/1'
     AND f.opn_joblog_001_id = j.opn_joblog_001_id
     AND j.contract = qw.NAME
     AND h.opn_joblog_001_id = j.opn_joblog_001_id
     AND h.opn_joblog_007_id = f.opn_joblog_007_id
     AND h.opn_joblog_006_id = f.opn_joblog_006_id
GROUP BY h.stage_id, h.slurry_type, h.slurry_vol_actual
the result I get is


SLURRY_TYPE TOTAL STAGE_ID SLURRY_VOL_ACTUAL
9,562.59 lead 1 490
2,184.84 1 80 tail
1,091.73 reload 1 56
3,431.64 tail 2 100
when i add f.item_number to the above query as shown below

SELECT   SUM (  (NVL (f.calc_cement_sk, f.calc_amount) * NVL (f.item_price, 0)
                )
              - (  NVL (f.calc_cement_sk, f.calc_amount)
                 * NVL (f.item_price, 0)
                 * (NVL (f.dis_per, 0) / 100)
                )
             ) total,f.item_number,
         h.slurry_type, h.stage_id, h.slurry_vol_actual
    FROM xxnp_opn_joblog_est_002 f,
         xxnp_opn_joblog_001 j,
         xxnp_opn_joblog_slurry_003 h,
         qp_secu_list_headers_v qw
   WHERE j.opn_job_desc = 'K/D/KD43/UG187/1338/D/0211/1'
     AND f.opn_joblog_001_id = j.opn_joblog_001_id
     AND j.contract = qw.NAME
     AND h.opn_joblog_001_id = j.opn_joblog_001_id
     AND h.opn_joblog_007_id = f.opn_joblog_007_id
     AND h.opn_joblog_006_id = f.opn_joblog_006_id
GROUP BY h.stage_id, h.slurry_type, h.slurry_vol_actual,f.item_number


the field total gets split and gives value corresponding to each item_number

i am giving the ouptut for stage 1
ITEM_NUMBER TOTAL SLURRY_TYPE STAGE_ID SLURRY_VOL_ACTUAL
5011.5 1020101001 lead 1 490
1308.93 1020102002 lead 1 490
127.215 1020111001 lead 1 490
138.92 1020112001 lead 1 490
686 1020113001 lead 1 490
550,5 1020113002 lead 1 490
1739.52 1020222010 lead 1 490
1517.1 1020101001 1 80 tail
379.5 1020102003 1 80 tail
83.2 1020103001 1 80 tail
166.53 1020104001 1 80 tail
38.511 1020111001 1 80 tail
1064,7 1020101001 reload 1 56
27,027 1020111001 reload 1 56


If we add up the values in the total field to the head, tail, charge that we get 9562.59,2184.84,1091.73 respectively

kindly Guide
to get the total value as application even if item_number is added
thanking in advance

Hello

You can do this by enclosing it with another selection

select
total, slurry_type, stage_id, slurry_vol_actual,
sum(total) over (partition by slurry_type, stage_id, slurry_vol_actual) from (
your actual select
)

concerning

Tags: Database

Similar Questions

  • Is it possible to get the total value of column and set to another area

    Hello

    Is it possible to get the total value of a particular column, and assign this value to another discipline?

    How to do this?

    Thanks in advance,
    SAN

    Hi SAM,

    If your controller class throw this message it means that it works very well. Follow these steps, I hope this will solve your problem.

    1 check the following

    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    OAViewObject ratvo = (OAViewObject) am.findViewObject("*CompetenceElementsVO*"); It should be the name of the instance instead of the name Physics vo vo.
    OAViewObject valuevo = (OAViewObject) am.findViewObject("*PerRatingLevelsVO*");

    2. extend this controller class that is associated with this region.

    I hope it will work now.

    Haroon.

  • How to get the total value of the array in a variable

    Hello

    Can you please let me know how can I store the value of a field in a column of advanced Table. I want this value for my validation. I tried looking on the forum under code... but it is not workng

    OAAdvancedTableBean distTable = (OAAdvancedTableBean) webBean.findChildRecursive("distributionRN");
    If (distTable! = null) {}
    OATableFooterBean distTableFooter = distTable.getFooter ((OATableFooterBean));
    If (distTableFooter! = null) {}
    Total OATotalRowBean = distTableFooter.getTotal ((OATotalRowBean));
    String value = total.getText ();
    System.out.println ("value" + value);
    System.out.println ("total" + total);
    }
    }

    The code above prints:

    null value
    Total OATotalRowBean, localName = 'totalRow.

    So basically getText() is nt working. Please suggest and thanks in advance.

    Mark answers as Correct or relatively useful so that others can take advantage of.

    Thank you
    Gerard

  • get the return value of a method of the application module in the workflow

    Hello

    I use jdeveloper 11.1.1.7.0

    I defined a method (return type is useful java card) in the Module of the Application and add this method to the client interface.

    also I have a workflow and in this TF firstly I should execute this method and put the return value for the pageFlowScope parameter. I know that to use this method as a methodCall and set it as an activity by default, but I don't know how to get the return value before entering the jsff page and set the pageFlowScope parameter.

    Habib

    Concerning

    When you add the activity to the way to deal, there are 'Return value' property that you can set to #{pageFlowScope.yourVariable}

    Dario

  • vSphere sdk api to get the total memory available for booking of virtual machine

    What vsphere sdk api should I use to get the total memory available to make reservations for virtual machines?

    Here's what I see in the VI client,

    Click on hos-> Configuration:

    Memory

    Physics

    Total xx

    System xx

    VMS 3512,0 MB

    Service xx console

    Now, when I click on the resource allocation tab I see

    3348 MB memory reservation

    Memorey reservation used: 0 MB

    Unreserved memory: 3348 MB

    The question is what value is correct and which are programming API to get all these values (even if it is wrong)?

    If you are familiar with the vSphere API, the easiest way is to browse through the documentation of API reference: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/index.html and/or using the CROWD (object browser), once you explore a bit, you will begin to understand where some properties of what you see on the vSphere Client

    For the configuration of host memory, take a look at: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.host.MemoryManagerSystem.ServiceConsoleReservationInfo.html

    To the memory of VM host accessible to the general public, take a look at: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.ResourceAllocationInfo.html

    To get information "Resource allocation", you must get a reference to the list of local resources for your host: http://www.vmware.com/support/developer/vc-sdk/visdk400pubs/ReferenceGuide/vim.ResourcePool.ResourceUsage.html#reservationUsedForVm

    Even if you do not have a "Resource Pool", there is a defect which still exists. This should get your started

    If you use the VI of Java, you can take a look at the VI Java Browser: http://www.doublecloud.org/2010/02/22/vijava-browser-a-great-tool-to-recommend/

    You must also follow Steve Jin blog (author/creator of connections of vSphere Java open source VI)

    =========================================================================

    William Lam

    VMware vExpert 2009

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    Twitter: @lamw

    repository scripts vGhetto

    Introduction to the vMA (tips/tricks)

    Getting started with vSphere SDK for Perl

    VMware Code Central - Scripts/code samples for developers and administrators

    VMware developer community

    If you find this information useful, please give points to "correct" or "useful".

  • Get the default value for class LV 1498 error

    I call get the Default Value.vi LV class to dynamically load a class.

    It was working fine until I added Open Config Data.vi to read an .ini file.

    The application works fine when I press the button RUN in the LabView development environment, but when I create the executable file with Application Builder and then run it, I get:

    "1498 error occurred getting class LV Default Value.vi"

    Possible reasons:

    LabVIEW: Library has errors. Correct the errors before performing this operation.

    «"" "String of full appeal:»»"»

    Download LV class by default Value.vi

    Test.VI

    LabVIEW has tried to load the class in this path:

    g:\cal\devices\Digital300Meter\Digital300Meter.lvclass

    I narrowed the problem down to open Config Data.vi included in the application, not in the class. I don't have to call the Open Data of Config vi to get this error.

    I have a Subvi, called "SelectDevice" which refers to Open Data from Config. In my main Test.vi SelectDevice is in the true case of a true/false case structure, which is set to False.

    If I put a design schema off around the Open Data of Config vi, I do not get the error.

    I suspect that including Open Config Data include a VI in the application that interferes with the LV ranks by default.

    Thank you, it works!

    I also put the additional Exclusions page as follows:

    Disconnect the type definitions - verified

    Remove unused polymorphic instances of VI - verified

    Remove unused libraries project - members verified

    Change the project library file after removing unused members - unaudited

  • How can I get the total number of pages printed on my LaserJet 3055?

    I have a nice 1012 LaserJet that is not supported in Windows 7, but there is a solution which is to set up a Vista driver as if the printer is a LaserJet 3055.  It works, even if sometimes I get a printed statement that it does not work, and when that happens I just turn off the printer and turn on again immediately and it is fine.  I would like to know if there is anyway I can get the total number of pages printed at some point, as I could with the LaserJet 1012.

    P.S. This thread was moved from software for Laserjet. -Hp moderator of the Forum

    Please ignore my post on the LaserJet 3055.  With the help of a good soul on another thread of discussion, I was able to install and operate my LaserJet 1012 printer on Windows 7, exactly as it did in XP.  No errors, no slow printing, no problem.  The LaserJet 3055 thing helped initially as a work around, but the message about the bad personality who stopped the printer until you turned off and turned it back was boring.

  • Unable to get the total number of records processed by the processor of trade rules

    Details of the environment

    ======================

    Disqualification Version: 12.1.3.0.0


    I use a business rules processor to implement multiple business rules on one record and I am looking for a summary of the number of records increased and does not have a specific rule.


    To illustrate:
    Suppose there are 2 rules, invalid number in Column1 and valid number on Column2.
    10 records to process and 3 folders don't rule 1 (valid on column1) and 9 entered failure of rule 2 (valid number on Column2).

    In the browser of result of the processor Business, the number of past records and failed is displayed but is not part of the output of the processor itself. In the example above, there will be 1 pass and 9 fail records and given the values of said the total number of records can be derived which is 10.

    This is why the expected output will be:
    Success of failure
    Rule 1:7 (10-3) 3
    Rule 2: 1 (10-1) 9
    Note: The number of records that failed can be derived from the table of the rule ID but I don't know how to get the total number of records in order to calculate the number of records that a given rule.

    I tried to publish the County of acceptance and rejection in the browser of result of the processor Business in an intermediate table and ask the same intermediate table to get the pass and fail values but Disqualification does not allow to write and read the same intermediary object in a single process. What is the best way to get the number of records total handled by the processor business rules? This kind of attributes (that do not exist only in the browser of result) can be included in the output of the processor in the next version of the Disqualification?

    In addition, the intermediate table contains only 1 sheet with pass and failure values while the exceptions which have individual failure on each rule contains 12 Archives. What would be the best approach to merge a single record into multiple records according to the example below?

    Staging table
    Success of failure
    1 9

    Exception table
    Single ID ID rule
    Rule 1 Record1
    Rule 1 Record2
    Rule 1 record Record3
    Rule 2 Record1

    Exception table with: staging Table data merge
    Rule ID ID Unique Pass Fail Total
    Rule 1 1 9 10 Record1
    Rule 1 1 9 10 Record2
    Recording rule 1 Record3 1 9 10
    Record1 rule 2 1 9 10

    Please notify.

    Hi Jason,

    The best way to explain how to do this is with an example project (DXI). I'll send you one in offline mode.

    -Mike

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • When I download and install, I get the language version of Slovenia even if I asked for the English.  How to get English?

    When I download and install, I get the language version of Slovenia even if I asked for the English.  How to get English? I have disabled on my ld machine and am trying to load it on a new machine

    Check the language of preference in the application of the CC.

    Mylenium

  • How to get the Total number of nodes XML?

    Hi all

    I have a Flash program that I do in Actionscript 3, using CS6.

    I use the XMLSocket class to read XML data. I'll write some examples of XML that is sent to the Flash

    program below...

    I know with this line here (below) I can access the 4th 'element or node' of XML data.

    To access the XML nodes/elements:

    * I created a Variable XML, called xml, and "e.data" contains ALL the XML data
    var XML = XML (e.data);

    Access to the 4th item of the data:

    . xml MESSAGE[3].@VAR;          -> 'loggedOutUsers '.

    . xml MESSAGE[3].@TEXT;         --->     "15"

    EXAMPLE OF XML DATA:


    < FRAME >

    0 < VAR MESSAGE = "screen2Display" TEXT = "FRAME_1" / >

    1 < VAR MESSAGE = "numUsers" TEXT = "27" / >

    2 < VAR MESSAGE = "loggedInUsers" TEXT = "12" / >

    3 < VAR MESSAGE = "loggedOutUsers" TEXT = "15" / >

    4 < VAR MESSAGE = "admins" TEXT = "2" / >

    < / FRAMEWORK >

    I'm new to Flash and Actionscript but I am very familiar with other languages and how paintings and other work, and I know for

    example, in a Shell Script to get the total number of items in an array called 'myArray' I wanted to write something like

    This-> ${#myArray [@]}. And since the data processing XML looks a lot like a table I thought that there was perhaps

    a way to access the total number of "nodes or elements" in the XML data...?

    Any thoughts would be much appreciated!

    Thanks in advance,

    Matt

    even if you don't need to run to the loop to know the length

    var levelList: XMLList = xml.children ();

    levelList.length (); This will give you the length of all children in your case of length MESSAGE of nodes;

    Pls click useful if my answer is helpful.

    Thank you

    Bala

  • How to get the updated value once the database is in place?

    Hello

    I have a scenario which is explained below.

    I have values from the DB for the first time and then consecutive application gets the value of the cache if the key is the same.
    One application is to apply. At that time, certain values change in the DB and then the DB is declining.

    Once the DB will get the new value of the cache. I tried this but I got the value from the cache (obtained only old value). The key is the same in DB, I changed the value and tested it.

    Is wot in the way that I am doing is correct? The same thing happens when I put the value in cache when DB is out of service.
    Will the data get updated as soon as the DB is in place? Also, this is not the case when I tested.

    I made the scenario above using distributed cache with manual configuration file that uses dumps.


    Thank you
    Mitraa SP

    Published by: SPM 6 November 2009 01:14

    The cache of almost is a "cache cache", then it can expire items out of its cache of 'before' (the local cache on the JAVA virtual machine running the code that requests information from the cache close), but which does not expire items in the cache 'return', which is the distributed cache.

    Caches are assembled in a hierarchical way, your configuration is something like this:

    1. a "cache near" which consists of a "local cache" (expiration) front and a back "distributed cache.
    2. the "distributed cache" that has a "reading / writing support map" for its data storage
    3. the "reading / writing map support" that delegates to a "Cache" store to talk to a database and a "Cache internal" for its storage
    4. the "internal cache' is probably configured as a storage card by default (which has not expired)

    To make data expire so that he is re-read, simply change the definition of "internal cache" in the read/write backup plan to use a similar setup that you use on the front of the cache close.

    For example, the example configuration file "coherence-cache-config. XML"(found in coherence.jar), you can change this"1 h"to 10"s"and expiration will occur in 10 seconds instead of an hour:

    
    
      example-binary-backing-map
    
      HYBRID
      {back-size-limit 0}
      BINARY
      {back-expiry 1h}
      1m
    
      
    
    
    
    
      example-read-write
    
      
        
          example-binary-backing-map
        
      
    
      
    
      true
      0s
    
    

    For an explanation of these braces, see: [coherence Configuration Macros | http://coherence.oracle.com/display/COH35UG/Parameter+Macros].

    Peace,

    Cameron Purdy | The Oracle coherence
    http://coherence.Oracle.com/

  • How to get the total line count COUNT (*) SELECT and put on a page?

    Hello

    I use JDeveloper 10.1.3.4. I need get the total number of rows in a table and display it on a page and the problem in doing so. At the sqlplus prompt the row count simply would be, for example:
       select count(*) from BILL;
    I wonder if having this simple number must be so complicated and if there is more simple, better ways. Here's how I do it and the problem encountered.

    1. the name of the page to display the number is summary.jspx. It has a grain of support that "summed" as the managed bean name in faces - config.xml, and the name of the bean class is "summary." The component output on the page is:
    <h:outputText value="#{summary.totalStudentsCount}"
                  binding="#{summary.outputText5}" id="outputText5"/>
    2. in summary the bean code is:
        private Number totalStudentsCount;
        public static int NUMBER = Types.NUMERIC;
    
        public void setTotalStudentsCount(Number totalStudentsCount) {
            this.totalStudentsCount = totalStudentsCount;
        }
    
        public Number getTotalStudentsCount() {
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            LoggedInStudentImpl studentTable = (LoggedInStudentImpl)zblcam.getLoggedInStudent();
            String sql = "select count(lsap_uid) from BILL";
            studentTable.setQuery(sql);
            return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
        }
    
        private ZBLCModuleImpl getZBLCModuleImpl() {
            FacesContext fc = FacesContext.getCurrentInstance();
            ValueBinding vb = fc.getApplication().createValueBinding("#{data}");
            BindingContext bc = (BindingContext)vb.getValue(fc);
            DCDataControl dc = bc.findDataControl("ZBLCModuleDataControl");
            ApplicationModule am = (ApplicationModule)dc.getDataProvider();
            return (ZBLCModuleImpl)am;        
        }
    
        protected Object CallStoredFunction(int sqlReturnType, String stmt, Object[] bindVars) {
            CallableStatement st = null;
            ZBLCModuleImpl zblcam = getZBLCModuleImpl();
            try {
                st = zblcam.getDBTransaction().createCallableStatement("begin ? := " + stmt + "; end", 0);
                st.registerOutParameter(1, sqlReturnType);
                if (bindVars != null) {
                    for (int z = 0; z < bindVars.length; z++) {
                        st.setObject(z + 2, bindVars[z]);
                    }
                }
                st.executeUpdate();
                return st.getObject(1);
            }
            catch (SQLException e) {
                throw new JboException(e);
            }
            finally {
                if (st != null) {
                    try {
                        st.close();
                    }
                    catch (SQLException e) {
                        throw new JboException(e);
                    }
                }
            }
        }
    The idea of calling a stored function usnig as a "helper" method is 25.5.3 in the Developer's guide, which is closest to you in my need. It's for the functions with the one IN argument; but in my case, the function is not any argument IN. That's why, when you call the helper method CallStoredFunction(), I gave an empty as the last argument and amazing array that caused the problem:
    return (Number)CallStoredFunction(NUMBER, "get_total_students(?)", new Object[] {});
    3. the registered function has been tested and works fine at the sqlplus prompt:
    create or replace function get_total_students
       return NUMBER
    AS
       v_student_count NUMBER;
    BEGIN
       select count(ldap_uid)
       into v_student_count
       from bill;
       return v_student_count;
    END;
    4. when the summary.jspx page is run, the browser is full of error messages, the first long line is here (I have split several online for ease of reading):
    javax.faces.el.EvaluationException: 
      javax.faces.el.EvaluationException: 
        Error getting property 'totalStudentsCount' from bean of type 
        zblc.viewcontroller.backing.staff.Summary: oracle.jbo.JboException: 
          JBO-29000: Unexpected exception caught: 
            java.sql.SQLException, msg=Missing IN or OUT parameter at index:: 2
    Thus,.
    (1) what is the problem? What is this parameter IN or OUT of {color: red} index: 2 {color} consult? It has to do with the empty array as the last argument in the call to the helper method?
    (2) this approach is an overdose, and are there more simple and better ways?

    Thank you very much for help!


    Newman

    Hello

    Is there a specific reason why you don't simply create read only object to display with some count (*) as OFCASES from MYTABLE and then just drag and drop the attribute ofcases in page?

    Kind regards

    Branislav

  • get the new value to select a radio station by ValueChangeListener Bean

    ADF / JDeveloper11g

    Hi Experts,

    Please help what I'm working on one Radio select and populated with a value of VO. I need to get the new value selected by ValueChangeListener Bean. the code as follows. Copy the following code I am old value, but I need to develop some new and current.

    Please help, its urgency.
      public void SlRadio(ValueChangeEvent valueChangeEvent) {
        getBranch();
      }
      public void getBranch() {
        // Add event code here...
    
        DCBindingContainer dcBindings =
          (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    
        // Get a attribute value of the current row of iterator
        DCIteratorBinding iterBind =
          (DCIteratorBinding)dcBindings.get("VOUserBranchList1Iterator");
        String vRtno = (String)iterBind.getCurrentRow().getAttribute("RtNo");
    
        setRtno(vRtno);
        System.out.println("=========Rtng========" + Rtno);
      }
    Thank you.
    Zed
    ======

    Hi Zaza,

    As you are able to get the index of the current selected option button, try upward with the selection of the value of the view object using the index you have found as

    If (valueChangeEvent.getNewValue ()! = null)
    {
    selectIndex = int ((Integer) valueChangeEvent.getNewValue ()) .intValue ();
    Line selectedRow = AMImpl.getVO1 () .getRowAtRangeIndex (selectIndex);
    If (selectedRow! = null)
    {
    selectValue = (String) selectedRow.getAttribute ("RtNo");
    }
    }

    where AMImpl is the object of the application module class.

    Kind regards
    Vikram

  • How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    How can I get the messages appear when sent even if my phone is locked. I only get messages across when I activate the phone

    Settings > Notifications > Messages > display on the lock screen

Maybe you are looking for