How to find running product

In oracle, is there a way we can find running product ?
create table an_t(col2 number)
insert into an_t(col2) values (3);
insert into an_t(col2) values (2);
insert into an_t(col2) values (4);
commit;
So we want to see in another column
result like this:
3*2 = 6
6*4 = 24 (above result multiplied by next row value)

You could use Tubby's suggestion. Although it's pretty accurate, still there is a chance of losing precision. Another suggestion is writing your own PROD function using ODCI interface:
create or replace
  type prod_type as object(
                           prod number,
                           static function ODCIAggregateInitialize(
                                                                   sctx in out prod_type
                             return number,
                           member function ODCIAggregateIterate(
                                                                self  in out prod_type,
                                                                value in     varchar2
                             return number,
                           member function ODCIAggregateTerminate(
                                                                  self        in  prod_type,
                                                                  returnvalue out number,
                                                                  flags in number
                             return number,
                           member function ODCIAggregateMerge(
                                                              self in out prod_type,
                                                              ctx2 in     prod_type
                             return number
create or replace
  type body prod_type
    is
      static function ODCIAggregateInitialize(
                                              sctx in out prod_type
        return number
        is
        begin
            sctx := prod_type(null) ;
            return ODCIConst.Success ;
      end;
      member function ODCIAggregateIterate(
                                           self  in out prod_type,
                                           value in     varchar2
        return number
        is
        begin
            self.prod := nvl(self.prod,1) * value ;
            return ODCIConst.Success;
      end;
      member function ODCIAggregateTerminate(
                                             self        in  prod_type,
                                             returnvalue out number,
                                             flags       in  number
        return number
        is
        begin
            returnValue := self.prod;
            return ODCIConst.Success;
        end;
      member function ODCIAggregateMerge(
                                         self in out prod_type ,
                                         ctx2 in     prod_type
        return number
        is
        begin
            self.prod := self.prod * ctx2.prod;
            return ODCIConst.Success;
        end;
end;
create or replace
  function prod(
                input number
    return number
    deterministic
    parallel_enable
    aggregate using prod_type;
/Now:
select  col1,
        prod(col2) over (order by col1 asc) as running_product
  from  an_t
      COL1 RUNNING_PRODUCT
         1               3
         2               6
         3              24
SQL> SY.

Similar Messages

  • How to find Application products?

    Hi Guru's
    1> How to find which product installed in the application,version, and where that products are shared or not with all information by running single script?
    2> how to find how many CPU are there in the system?
    Thanks

    1> How to find which product installed in the application,version, and where that
    products are shared or not with all information by running single script?Use $AD_TOP/sql/adutconf.sql
    2> how to find how many CPU are there in the system?What is the OS?

  • How to find the product key on a preinstalled version of Windows 8?

    This is a similar qustion:
    https://forums.lenovo.com/t5/Windows-8-and-8-1-Knowledge-Base/How-to-find-the-product-key-on-a-prein...
    But its not actually explaining which part of the BIOS menu contains the windows key.
    I see a UUID  number -- but that doesmt match the windows 8 5x5 code format.  SO!
    where can I locate the windows 8 key in the BIOS?

    On recent ThinkPad, the Product ID Key sticker has been moved from the bottom of the unit to behind the battery.
    You need to contact Lenovo technical support directly to ask about recovery media.

  • How to find cc product code

    Need to talk to some one about my products and merging cs5 upgrade to cc account

    Cloud Getting Started https://helpx.adobe.com/creative-cloud/topics/getting-started.html
    Adobe contact information - http://helpx.adobe.com/contact.html

  • How to find the material based on the division.

    Hi All,
    My requirement is to read the all the material(products) in the division.
    I have executed  transaction code:COMMPR01 and seen division field  in material tab.
    I found the table CRMC_DIVISION but i did not find any maetial.
    Please help me how to find the PRODUCT in the division.
    Thanks,
    Venkat

    Hi Venkat,
    There are three tables that you need to refer to get the products for a particular division in CRM.
    1. Go to table COMM_PRMAT, pass the division and get the Set Guid for all the products
    2. Go to table COMM_PR_FRG_REL, pass the Set Guid and get the Product Guid of all the products.
    3. Go to table COMM_PRODUCT , pass the product guid and get the list of product ID which belongs to that particular division.
    I hope this will help you.
    Regards,
    PP

  • How to find the window 8.1 product key

    hello everyone, i recently purchased a notebook with window 8.1 and created an window recovery disk but due to some problem i got the DOA letter for this device and get a new laptop ,i want to know that now i have to create copy of recovery disk again or last recovery disk that i had made with last laptop had same operating system will work please suggest me  i have one more question how can i find the product key of optrating system installed on my laptop..  thanks and regardYogi

    Hi,
    The key is in the BIOS of your machine, please use the following tool to get it:
       http://www.belarc.com/free_download.html
    When run this tool, it produces a report, scroll down to Software Management section. Windows 8 or 8.1 product key is in there.
    You can also use the following tool to find out:
      https://www.magicaljellybean.com/keyfinder/
    Using other set: For a SAME series, this may work. Regards,  

  • How to find out the list of Production orders created for sales orders

    Dear All,
    Our company wants to generate a report for a List of Materials sold out in a particular Product Hierarchy. Along with that we want to know the list of Production orders created for the sales orders.
    How to identify the production orders which are created based on Sales orders.
    Kindly suggest.
    Regards,
    Mullairaja

    Check these threads
    [Sale Order & Production Order|Sale Order & Production Order;
    [Re: Linking Production Order against a Sale Order MRP run|Linking Production Order against a Sale Order MRP run;
    thanks
    G. Lakshmipathi

  • How to find what transaction an user was running for a given period

    hi
    could anybody tel me
    how to find what transaction a particular user was running for a given period
    in the past.............

    Hi,
    U need to findout the list of Tcode excuted by SAP user
    1) Tcode: ST03N
    2) Select Expert Mode option
               (there u find  Server Host name & Today)
       If u select Host name u find DAY/WEEK/Month (same thing will in Today option)
    3)Now u need to select the option of DAY,WEEK etc.
    Now u can find in two ways
    1) Transaction profile (Standard / EarlyWatch)
    2) User (user profile)
    If u select the Transaction profile
    Under these u find the option of Aggregation----application/package/tranasation etc.
    I hope these will help u to findout.
    Regards
    ASR

  • How to find the particular record in 1000's of workflow jobs are running

    Hi,
    In a data manager -> in workflow tab>IF a record is in CHECK-OUT MODE there are 1000's of jobs are running in that workflow tab. Can anyone tell me how to find that particular record in that workflow jobs.
    Can anyone show me the difference in getting a record in 5.5 and 7.1

    Hello COTI
    Unfortunatly, SAP MDM doesn't have good ability for  WF search.
    All WF clarify by it's status (unlaunched, avialable, Received, complited, error  etc.)
    For each WF SAP MDM assing unique Job ID and this id will be shown in Job ID field in Data Manager WF Tab.
    You can change WF list order by all WF fields like as Job ID, Step, User, Start etc. and try to find your's WF.
    You can use Java API - this is one of the best solution for WF management and WF mass upload  (for example)
    Regards
    Kanstantsin Chernichenka

  • How to find out which server is running on which port

    hi all,
    how to find out which server is running on which port, i want to know both
    from front end and backend?
    thanks and regards
    srikanth

    The best source to get all the ports you have is the Context Files.
    All ports are defined in the Context Files through "AutoConfig Variable". You can get the list of those variables by referring to the following note under "What is the port pool? What if I want to give a specific value to a Server Port?"
    Note: 216664.1 - FAQ: Cloning Oracle Applications Release 11i
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=216664.1
    You can also get that list via OAM.
    Referring to the installation log file should also be helpful (Unless you have changed any of the ports after the installation).

  • I am a high school teacher.  My district purchased the entire CC Suite.  Where can I find a tutorial in book form to learn how to use your products?  Do you all provide free book samples to teachers?

    I am a high school teacher.  My district purchased the entire CC Suite.  Where can I find a tutorial in book form to learn how to use your products?  Do you all provide free book samples to teachers?

    Good day!
    This is a user to user Forum, so you are not really addressing Adobe here, even though some Adobe employees thankfully have been dropping by. (edit: Actually they are more likely to frequent the regular Photoshop Forum.)
    Regards,
    Pfaffenbichler

  • How to find out who has deleted the production Query

    Hi All,
    I have searche SD , i can find it for infoobject deletion but i couldn't find it for Query.
    Please let me know is there any possiblity to kow
        How to find out who has deleted the production Query
    Awaiting for your replies.
    cheers

    Hi Mahesh and all,
    Thanks for all your  inputs.
    I have tried with RSRREPDIR tabel , I am unable to see that query at all.
    If I use theT-code SLG1,
      please guide me on the steps with paramets to be given in the respective ..object, subobject etc..
    OR
    could you please suggest any other way.
    cheers
    leena

  • How to find what type of middleware product we are using in SAP CRM ?

    Hello All,
    Ca anyone help me in getting the information  for the following :
    1) How to find out what type of middleware product we are using in our Project? ( Currently our SAP CRM version is 4.0 and the middleware is using for R/3 to SAP CRM and vice versa)
    2) Do we have a product called u201CMessaging wareu201D used in SAP ?
    Kindly revert at the earliest .
    Cheers
    Sreedhar

    Hi Sreedhar,
    What you've mentioned is exactly the task of CRM Middleware, which sits on the CRM server and governs the data flow.
    By any chance are you trying to find out about DOE(Data Orchestration Engine) used by SAP NetWeaver Mobile ?
    maybe this link would help then:
    http://help.sap.com/saphelp_nwmobile71/helpdata/en/7f/c9391404c74fabb8ccc321bac64e8d/content.htm
    -Rohit

  • How to find out the last date & time on which a program has been run

    Hi Experts,
    Can anybody tell how to find out the last date on which a purticular program has been run.
    Valuable answers will be rewarded.
    Thanks & Regards,
    Satish.

    Hi!
    Try STAD transaction. Unfortunately it contains a huge amount of data, so it is available only for a few days backwards... Maybe some weeks, but you can't make yearly reports from its data... So it's not useful to see, which program is in use or not...
    I planned once to download it weekly, but it was not so important...
    Regards
    Tamá

  • HT1529 How to find another Apple ID is registered my Product the Serial number.

    How to find another Apple ID is registered my Product the Serial number.
    my Apple Product cannot register to my Apple ID.

    https://appleid.apple.com/cgi-bin/WebObjects/MyAppleId.woa/

Maybe you are looking for

  • Open and Save Excel Files

    Hi All, I need code of How to open and save excel file in local system in Oracle forms. With Regards, Chandra Shekhar

  • CS3 "Script Alert" !?

    Hello ! Using my (licenced and registered) Photoshop CS3 Extended to process my NEF files coming from my Nikon D300 never made a problem, ...till yesterday ! It first opens under Bridge CS3 (as usual) to be able to roughly tune the exposure, light an

  • I used up half my data in two days!

    I just signed up with Verizon after being a faithful Boost customer for several years. I got the Samsung Galaxy S6 and started playing around with it. Today I noticed that I have used up half of my 1GB data in just two days! This is kind of dishearte

  • Software-updater

    software-updater

  • New Desktop software synching with my iTunes

    i have a Storm 2 and a Macbook and downloaded the new software but it seems the same as the old. How do I upload my itunes library? Thanks for any help I am going to keep searching the website for help.