Need to show the customer the invoice amount is constant for three months

Assume that the user will give the month and year (ex: March 2011) then result will show all customers whose the invoice amount is same in March, Feb and Jan-2011 and the result will appear in three lines.
For these, I need to create a point of view and the corresponding query. The combined output should be-

Cust_id Base_month Bill_amount

1 500 03 - 2011
1 Feb 2011 500
1 jan-2011 500
9 Mar 2011 800
9 Feb 2011 800
Jan 9, 2011 800

Can someone help me?

Not clear.

SQL> select *
  2  from test_bill
  3  order by cust_id,bill_month;

   CUST_ID BILL_MONT   BILL_AMT
---------- --------- ----------
         1 01-DEC-10        400
         1 01-JAN-11        500
         1 01-FEB-11        500
         1 01-MAR-11        500
         1 01-APR-11        600
         2 01-FEB-11       2000
         2 01-MAR-11       1000
         3 01-JAN-11       1500
         3 01-MAR-11       1500

9 rows selected.

SQL> select cust_id,bill_month,bill_amt
  2  from(
  3  select cust_id,bill_month,bill_amt,
  4         max(case when bill_amt = prev_bill and bill_amt = prev_bill2 then 1 else 0 end)
  5              over (partition by cust_id) flg
  6  from(
  7  select cust_id,bill_month,bill_amt,
  8         lag(bill_amt) over(partition by cust_id order by bill_month) prev_bill,
  9         lag(bill_amt,2) over(partition by cust_id order by bill_month) prev_bill2
 10  from test_bill
 11  where bill_month between add_months(to_date('Mar-11','Mon-yy'),-2) and to_date('Mar-11','Mon-yy')
 12  )
 13  )
 14  where flg = 1;

   CUST_ID BILL_MONT   BILL_AMT
---------- --------- ----------
         1 01-JAN-11        500
         1 01-FEB-11        500
         1 01-MAR-11        500

Tags: Database

Similar Questions

  • What is the maximum amount of RAM for the HP ENVY 15-j015sr model?

    By default, the model HP ENVY 15-j015sr worth DDR3L SDRAM 8 GB. What is the maximum amount of RAM for this model?

    Where can I find a list of the modules supported DDR3L SDRAM for this model?

    Service guide says like that

    Two clients-available/expandable
    memory module slots
    Support for DDR3L (1600 MHz)
    dual channel
    Support for 16834-MB of RAM
    in the following configurations:
    ● 16834-MB (8192 MB × 2)
    ● 12288 MB (8192 MB + 4096 MB)
    ● (8192 MB × 1, 4096 - 8192 MB
    MB × 2)
    ● 6144 MB (4096 MB + 2048 MB)
    ● 4096 MB (4096 MB × 1, 2048-
    MB × 2)

  • I need to know the process to implement encryption for Windows 8, on a HP Pavilion

    Original title:

    Encryption

    There is a choice in my control panel to set up encryption, but I have to go through the TPM module to be able to put in place, and my PC is not safe and has never been, I need to know the process to implement encryption for Windows 8, on a HP Pavilion

    Hello

    Protect your files with the encryption device
    http://Windows.Microsoft.com/en-us/Windows-8/using-device-encryption

    Protect your files using BitLocker Drive encryption
    http://Windows.Microsoft.com/en-us/Windows/protect-files-BitLocker-Drive-Encryption#1TC=Windows-8

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • After purchasing the cloud creative and used for 2 months (for example), so I don't use it for 3 months. How is it? I don't have to pay the tariff for each month, or is it possible to only pay when I use it again? To resume: if I use it for 5 months a

    After purchasing the cloud creative and used for 2 months (for example), so I don't use it for 3 months. How is it? I don't have to pay the tariff for each month, or is it possible to only pay when I use it again? To resume: if I use it for 5 months a year, I have to pay for only those 5 or 12 months?

    No, if you have a subscription according to the type of subscription, you will have to pay each month or year until that you cancel.

    If you think you would use the apps for only three months, then you will not need three months, then our month to month plan would be best for you because it can be cancelled at any time it does not come with an annual contract for more information see the link below

    Adobe - General conditions of subscription

    Kind regards

    Bani

  • I bought the Photoshop 19.99 plan for a month so that I can check the new Illustrator and other new programs CC and see if I liked the concept... Now that I checked out, I decided to upgrade to the full cloud...  There is a prom one year

    I bought the Photoshop 19.99 plan for a month so that I can check the new Illustrator and other new programs CC and see if I liked the concept... Now that I checked out, I decided to upgrade to the full cloud...  There is a promotion for one year to 29.99 per month for users of cs3, but when I try to upgrade my contract he wants to load the full 49.99... is there someone I can call?

    Hello Mary,.

    There is a telephone support | Orders, returns and exchanges, you can use > http://helpx.adobe.com/x-productkb/global/phone-support-orders.html.

    If necessary and for further questions click on http://helpx.adobe.com/contact.html and 'open' Please use the cat, I for my part had the best experiences. I quote Adobe Preran employee: the chat button is enabled as soon as there is an available agent to help.

    Hans-Günter

  • Customize the invoice amount field

    We "Allow Paid invoice adjustments of accounts payable is activated" but I want to stop users update the amount of the invoice, once the invoice has been paid.
    I mean yes they can reverse and redistribute the invoice lines but want to stop them will increase the amount.
    Is this possible to the customization of the form?

    Hello.

    Try this:

    Conditon

    Trigger event-> a TIME NEW POINT INSTANCE
    Trigger object-> INV_SUM_FOLDER. INVOICE_AMOUNT_DSP
    Status->: INV_SUM_FOLDER. INVOICE_AMOUNT_DSP =: INV_SUM_FOLDER. INV_CURR_AMOUNT_PAID

    (Attention to two points)

    Action

    Object-> point type
    Target-> INV_SUM_FOLDER object. INVOICE_AMOUNT_DSP
    The property name-> ENABLED (APPLICATIONS COVER)
    Value-> FALSE

    Note: it's 11i, so if you use a version more recent block and domain names may differ.

    I hope this helps.

    Octavio

  • Need to show the same values in all jspx pages

    Hello.

    I use jdeveloper 11.1.1.5

    I had created a jspx pages such as dept.jspx and emp.jspx

    I've been using this in my jspx page
     <af:outputText value="#{bindings.return.inputValue}"
                               binding="#{pageFlowScope.backing_dept.ot1}"
                               id="ot1"/>
    The bindings.return.inputValue will return the value of the code below
        public String checkLoginCredentials1(String p_user,String p_pwd)
        {
        System.out.println(p_user + " " + p_pwd);
         ApplUsersVOImpl  vo = (ApplUsersVOImpl)this.getApplUsers1();
         /*set the bind variable value*/
        vo.setNamedWhereClauseParam("p_user",p_user.toUpperCase());
        vo.setNamedWhereClauseParam("p_pwd",p_pwd.toUpperCase());
        vo.executeQuery();
        int rowCount=vo.getEstimatedRangePageCount();
        System.out.println("rowCount="+rowCount);
        if(rowCount==0) 
        { 
           throw new JboException("Password doesn't match");
         }
           return "Welcome"+ "  " + p_user.toUpperCase();
        } 
    My scenario is that I need to display the same value in emp.jspx

    I had created a task flow frm dept.jspx to emp.jspx and emp.jspx to dept.jspx

    I tried the same XML file in my emp.jspx
    <af:outputText value="#{bindings.return.inputValue}"
                               binding="#{pageFlowScope.backing_emp.ot1}"
                               id="ot1"/>
    But while I m browsing frm emp.jspx to dept.jspx there are doesnot.,.

    This means that for the faces-config. XML (the standard JSF configuration file), there is no scope spanning application except for the scope of the session. This does not mean that you should not use extended session if you use faces - config.Xml.

    However, you have been advised to use the workflow and no faces - config.Xml.

  • How to lock the browser settings? I need to deploy the latest version of firefox for the company

    I work for a company users 4000 + and I was tasked to deploy the latest version of Firefox. I need to lock the browser, home page of facility settings, disable auto updates, rename (for example Mozilla Firefox browser provided by companyname). I was able to do with firefox 3.x, but I can't seem to make it work with the version 7.0.1

    The greprefs file no longer exists with the change using a ZIP archive omni.jar and you place a local file - settings.js in the defaults\pref instead.

    You can use a mozilla.cfg file in the Firefox program folder to lock the prefs or specify default values.

    Place a local file - settings.js in the defaults\pref folder where you will also find the channel - prefs.js to specify using mozilla.cfg file.

    pref("general.config.filename", "mozilla.cfg");
    pref("general.config.obscure_value", 0); // use this to disable the byte-shift
    

    See:

  • How everyone counts the total amount of GHz for virtual machines on a host-cluster?

    Hello

    I want to do some basic sizing and I may\may do not go the way to write about it.  For example, suppose I have a cluster of 4 nodes with a total of 200GHz and 1 TB of RAM on all four hosts with 100 VM.  How can I get the total amount of GHz\Memory that each virtual machine is configured with (not necessaryly to aid real-time) so that I can workout or demonstrate what fits on one or two hosts in the cluster, for example?

    Thanks for your help and advice in advance

    You can do this via the inventory tool called RVTOOL which allow you to do an inventory of all your virtual machines and hosts with the resource assigned and served. hope, it will help you.

  • Need advice on the rendering of a file for authouring PAL DVD, format, codec, compression

    Hello.

    Im working on an experimental audiovisual project that needs to be exported to a file that will be used for the DVD to a compilation of creative works. IM pretty much against it time, the deadline is close and im spending many hours trying different settings - output but still im do not reach the level of quality in the final file I expect to see.

    Ive been given technical specifications are:

    -Maximum duration: 6 min.
    -PAL
    -16 x 9 if possible
    -mov file if possible

    My compostion is in black and white and shades of gray. It was out of a video Toolbox in real-time, but I infact used Fraps to capture uncompressed video, as her reacts software at in realitme sound. No problem here, the images I got is fine and works perfectly, at 30 frames per second (here is perhaps one of my problems that maybe I should have output/captured video at 25 frames per second since I understand what the rate for PAL)

    Anyway Ive done my compostion by superimposing several segments of the video captured in sync with the sound.

    (1) first of all, whenever I out in any format, everything becomes a little grey - IE the bottom black deep perfect dark gray go. How can I avoid this?

    (2) what is the best type of file to the format/path/from out for the conversion of best quality of 30 frames per second at 25 frames per second. I noticed that the video becomes slightly jerky when I got out with a PAL output configuration preset.

    I would appreciate if someone could guide me on the best possible formats/file types and the bitrates to deal with this specific set of cladding im problems. Unfortunately, I need to make the due date in the coming days.

    Thank you very much

    p

    If you create a DVD, there is really no choice of codecs, since the DVD-video is a very specific and closely forced to MPEG-2 video form. MPEG-2 video is highly compressed and is not a format high definition, so it is absolutely inevitable that export to DVD video will cause a loss of quality. This is true for the same professionally created DVD. There is a DVD MPEG-2 export preset in After Effects that you can choose in the Format menu in the settings of output Module dialog box.

    If, however, you are given your video as input for a larger work, and you must create an intermediate file that keeps all the details for as long as possible in the post-production pipeline, you should view and export using lossless coding. My preference for the creation of intermediate files compressed without loss of sources of 8 bits-per-channel is the PNG video codec in QuickTime (MOV) container.

    For information on the compression and the choice of the parameters for specific purposes, see this FAQ entry (and the pages it links to the):

    http://forums.Adobe.com/thread/729526

    You said 'jerky' output. See this FAQ entry for more information on the movies encoded without loss and how they are not suitable for reading:

    http://forums.Adobe.com/thread/684381

    Or maybe saccades comes from the inadequacy of the frequency of frames between your source 30 frames per second and 25 frames per second composition. If so, then interpolation can help.

  • Windows family vfista premium is broken, but not the dell printer. products do not work for three months windows

    I have installed windows securitity, now three months of windows products don't work, it's time I'm asking for help, I lost the mail, internet, do not download, made-it is not working it's time I am asking for help, I lost the mail, internet, do not download, made-it doesn't work nor does she Live Gallery windows, it will not udate. the entire system is ruined, had to use incredimale and foxfire, re-installed Pack2, now it of really a mess, had too use sysytem restore dell, now say that dell drive hard has problems, spending 6 weeks with lasy tech, lost everything, so now what?

    proven system repair, nothing, tried to reinstall, he left 90 percent of the old stuff still there, I can't get downloads, patches, nothing that is microsoft works.

    I have to clean the machine and get 7, will operate 7 or have the same problems? I was usig stinger, ad-aware and spybot just to clean the machince, and I always get more trogens then Troy! husband uses a gateway on the same router, never spent a McAffee and a has no problem, every day it's something new, when it downloads, it said: it is the missing pieces and will not work.

    This is the third time I have tried to save my stuff to say-connected usb, hard drives, seven is better, the disk of vista that I messed up? It worked fine until I used the basics of microsoft.

    Thanks, I'll check some of your links, I was up all night with Dell, they did all the tests imaginable and agreed it was the vista software and not a virus or malware, they also checked with their people for the compatibility problems with windos 7, since this is the third time I would be re - install it and I went to buy windows 7 , he already has accompanied me throughout the entire upward and the account if I need help or advice, he will be free.

    So tonight I'm going only to remove my sweet that I bought or have the disc, then personal stuff like photos etc and I will do a clean install. I also had a new manual of windows 7 from microsoft for reference, thanks for the time, effort and helps you offered, some of these links might help me as I install it.

    Once again thnak you.

    Which

  • With the help of individual programs for a month at a time

    Hi, I just signed up for creative cloud and have subscribed to the Photoshop/Lightroom package - I'm a former freelancer and a bit of a handyman so once every two years, I may need to use After effects or for another job, Illustrator (and I'm very curious about Muse).
    I was wondering if it is possible to use an application like Illustrator CC and pay for one month at a time?  I may not be no need to use it for another year by little, depends when I need them.

    East - CC has this flexibility?

    See you soon

    Sabine

    Sure. You can buy a single month as paid whenever you need.

    Mylenium

  • I would like to remove the automatic renewal for three months of Apple's music essay. How do I do that?

    I did the free trial of three months 'Apple music' a week ago. I don't want now, and I don't want that it is automatically renewed at the end of three months. How to handle this in my account? It doesn't seem to be a zone of disengagement.

    Click here, follow the instructions and wait until it expires.

    (139634)

  • Hi... archives showing that status applied 'NO' and 'YES' waiting for 2 months... suddenly disappears.

    Hello...

    Archives showing the status applied 'NO' & 'YES' waiting for 2 months (since the drilling of switching)... now applied = NO suddenly disappears.

    No activity done recently waiting...

    standby is synchronized.

    Any ideas on this... Thanks in advance!

    > Archives showing applied as no. and disappeared are removed long bin

    And here the entries have been removed since the controlfile only recently.  Oracle can only handle a limited number of entries in the controlfile.

    Hemant K Collette

  • DataTemplate not display data, but showing the right amount of lines

    I just started to use Datatemplates to convert our answers on Publisher reports. Basically, I use the PASS-THROUGH method BI Server.
    Copy the SQL from the SQL field advanced in BI answers.
    Place the new SQL in DataTemplate
    Construction DataStructure

    It seems to a sufficient quantity of lines, but no data is displayed. I checked the data multiple times for misspellings and other simple items but I'm not. It seems to make a connection very well, but it does not show and value in data elements. It returns 6 empty lines.

    Attached XML example:
    < name of dataTemplate = "FiveDayCo" defaultPackage = "" than one dataSourceRef = "OracleRPD" > "
    Properties of <>
    < property name = "include_parameters" value = "true" / >
    < property name = "include_null_Element" value = "true" / >
    < property name = "include_rowsettag" value = "false" / >
    < property name = "scalable_mode" value = "off" / >
    < property name = "db_fetch_size" value = "300" / >
    < / properties >
    < Settings / >
    < lexicals / >
    < dataQuery >
    < sqlStatement = "COOR" name > <! [CDATA [SELECT "-match". "% response time of 5 day correspondence" "saw_0, 90% ' saw_1," "-correspondence".]] "% Response time of 5 day match"-90 saw_2,""-match details "". "" Type of correspondence' saw_3 OF finance WHERE ("-match details". "") (Match type' IN ('Customer Service', 'Systematics', 'Not available', 'Privacy')) AND ("Business Unit". ("' Business unit ID" = 6.00) AND ("'-record details" "." ") Record type' = 'Core') AND ("-matches details". "") (Correspondence of State' <>'closed') AND (("-primaire terminé Date prévue".)) "" Primary year expected "= cast (YEAR (date '' 2010-07-01) as char (4))) AND (" "-Date completed expected primary" "." ")" Primary planned calendar month "= MONTH (date ' 2010-07-01'))) [ORDER BY saw_1, saw_3]] > < / sqlStatement >"
    < / dataQuery >
    < dataStructure >
    < group name = "Coorespondence" source = "COOR" >
    < element name = "FiveDayCoorespondenceTime" source = function "saw_0" = "" / >
    < element name = "ValeurIPC" source = function "saw_1" = "" / >
    < element name = "Variance" source = function "saw_2" = "" / >
    < element name = "CoorespondenceType" source = function "saw_3" = "" / >
    < / Group >
    < / dataStructure >
    < / dataTemplate >

    A few things to check. The sql by itself returns the data?

    Also, you need the following: ? If a package is not used/needed, remove the reference.

    The following tag should suffice.

    Your datastructure code must be: (for the name of the element using the value (instead of source =) and I removed the syntax of the function since you don't specify any function like sum, average)








    For a reliable data model reference, check the following: http://blogs.oracle.com/xmlpublisher/2009/06/data_template_progression.html

    Hope that helps!

Maybe you are looking for