Unable to display data for the date where there is no entry in the table

Hello

I need a urgent, described below:

I have a table named as 'dirty', consisting of three columns: empno, sale_amt and sale_date.
(Please ref. The table with data script as shown below)

Now, if I run the query:
"select trunc (sale_date) sale_date, sum (sale_amt) total_sale of the sales group by order trunc (sale_date) by 1.
It then displays the data for the dates there is an entry in this table. But it displays no data for the
date in which there is no entry in this table.

If you run the Table script with data in your schema, then u will see that there is no entry for the 28th. November 2009 in
sales table. Now the above query displays data for the rest as his dates are in the table of the sale with the exception of 28. November 2009.
But I need his presence in the result of the query with the value "sale_date' as '28. November 2009 "and that of"total_sale"as
« 0 ».

Y at - there no way to get the result I need?

Please help as soon as POSSIBLE.

Thanks in advance.

Create the table script that contains data:
------------------------------------------

CREATE TABLE SALE
(
NUMBER EMPNO,
NUMBER OF SALE_AMT
DATE OF SALE_DATE
);
TOGETHER TO DEFINE
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE (DECEMBER 1, 2009 10:20:10 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE (NOVEMBER 30, 2009 10:21:04 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE (NOVEMBER 29, 2009 10:21:05 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE (NOVEMBER 26, 2009 10:21:06 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(100, 1000, TO_DATE (NOVEMBER 25, 2009 10:21:07 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 5000, TO_DATE (NOVEMBER 27, 2009 10:23:06 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 4000, TO_DATE (NOVEMBER 29, 2009 10:23:08 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 3000, TO_DATE (NOVEMBER 24, 2009 10:23:09 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(200, 2000, TO_DATE (NOVEMBER 30, 2009 10:23:10 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 7000, TO_DATE (NOVEMBER 24, 2009 10:24:19 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 5000, TO_DATE (NOVEMBER 25, 2009 10:24:20 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 3000, TO_DATE (NOVEMBER 27, 2009 10:24:21 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 2000, TO_DATE (NOVEMBER 29, 2009 10:24:22 ',' DD/MM/YYYY HH24:MI:SS'));))
Insert into SALES
(EMPNO, SALE_AMT, SALE_DATE)
Values
(300, 1000, TO_DATE (NOVEMBER 30, 2009 10:24:22 ',' DD/MM/YYYY HH24:MI:SS'));))
COMMIT;

Any help will be necessary for me


Kind regards
WITH tab AS
  (SELECT TRUNC(sale_date) sale_date,
    SUM(sale_amt) total_sale
     FROM sale
   GROUP BY TRUNC(sale_date)
   ORDER BY 1
  )
 SELECT sale_date,
  NVL(total_sale,0) total_sale
   FROM tab
   model
   REFERENCE refmodel ON (SELECT 1 indx, MAX(sale_date)-MIN(sale_date) AS daysdiff , MIN(sale_date) minsaledate FROM tab)
     dimension BY (indx)
     measures(daysdiff,minsaledate)
   main main_model
   dimension BY (sale_date)
   measures(total_sale)
   RULES upsert SEQUENTIAL ORDER ITERATE(1000) until (iteration_number>refmodel.daysdiff[1]-1)
   ( total_sale[refmodel.minsaledate[1]+iteration_number]=total_sale[cv()] )
ORDER BY sale_date

using a clause type

Ravi Kumar

Tags: Database

Similar Questions

  • How can I change the display settings for the lifecam VX-2000 software provide a mirror image?

    I've tried everything and looked everywhere online.  Can you help me?

    Hi ToniDanile,

    You can change the display settings for the LifeCam software to fix the problem.

    For more information see the article mentioned below:

     

    Don't troubleshoot bad or no video or problems to start the LifeCam software

    http://support.Microsoft.com/kb/933310

    Let us know if it helps.

  • After using the iphone app, I get error: "unable to get labels for the script.

    Hello

    I think that this is related to the iphone app for Adobe Story. I added some comments on my script using the application, now when I try and open my script, I get an error; "Unable to get labels for the script.

    I tried Internet Explorer 9 and the desktop application. Both produce the same error.

    The script is completed to 55 pages, so I really don't want to lose...

    Thank you

    Hi Chris,

    We have fixed the problem and shared the document with you back. You can accept the notification, copy the document into a new (to be an owner) and work on it now. Meanwhile, we will also investigate why the problem occurred at all.

    Sorry for the inconvinience.

    Kind regards

    Sunny

  • Error ERR-1002 unable to find item for the 'ID' element ID in the application

    Hello world

    I'm new to APEX and I came across this error for the first time. I have a page with a classic report in it, and I want to create a link to one of the columns in the report (column ID) to another page with a classic report in it. So when I click on, say, ID 118, I want to be sent to another page and don't see ID 118 information.
    After you create the link in the column, I get the error message when I run the application:

    Error ERR-1002 unable to find item for the 'ID' element ID in the application

    I tried to create a link from one report to the other before and it worked fine.

    Thank you!

    P.S. I use APEX 3.2

    Then you must create an item called ID on your page 2 (hidden make) and the link will pass the value of the ID of the line picked up on this hidden item. Now in page 2 make your report filter query on id = P2_ID or another name that you use...

    Hope this helps,
    His

  • Iterator for the table and form is a problem during the cleaning of the records

    Hello

    I use JDev 12.1.2.

    I have an object of the detail view. I represent a part of its fields in a table and the rest in a form. I use the same iterator. Basically, I dragged and dropped the object even from the view of the data control and created a table and form layout with the fields I wanted in each provision. I put in place a clear feature for the rows in the table with a clear"" key. -on click I delete the line of the iterator in the managed bean. When I do this the selected record is deleted and the next record is displayed. But fields entered in the form layout also gets deleted. (the form should also be showing the record currently selected - it shows but entrable fields in the form are deleted because of claire that I did on the previous line.) If anyone can help get this resolved?

    Not use the same iterator for the tables and forms here? The links are in the row (row.bindings...) for the table, but for the form it is (links...). The Delete on the current row operation is causing the iterator delete all fields of links instead of from the line? Please shed some light.

    Thank you

    UMA

    How do you rank on the iterator compensation?

    use resetActionListener in your clear button and let us know what is happening?

    Ashish

  • JDev11g - prevention of query for the table running until ExecWithParams press

    JDev 11 g ADF-Faces with task flow creation web app - test a single page.

    I have five variable bind I have installed with reference LOV to display the name return ID's, two are dates that work now! I have the ExecWithParams button, then on a table that uses a VO with a custom query with the dregs.

    I need links to be filled, but the page takes a while to load, and my guess is that the request for the table tries to run, but does not receive all the data since the lie is empty at the start. The query runs great once I have complete binding and press the ExecWithParams button.

    How can I stop the query in the table to run until the ExecWithParams button is pressed? I'm guessing that this is the problem since it takes several minutes when the link to the browser is launched and makes the page actually. All requests for links are very simple, while the request of VO is very complex. Or maybe something else wrong that I'm not getting?

    Thank you, Ken

    Something that I use occasionally is the substitution of the VO executeQuery method.

        public void executeQuery() {
            if (getWhereClause() == null){
                setWhereClause("1=2");
            }
            super.executeQuery();
        }
    

    It works for running dynamic bind variable.

    For your case, you could do something like...

        public void executeQuery() {
            if (getNamedWhereClauseParam("YOUR_BIND_VARIABLE") == null){
                setWhereClause("1=2");
            }
            super.executeQuery();
        }
    
  • primary key for the table

    I have a Gr_order table that was settled long ago, and now he needs to be filled
    with some more search data.

    "Orderid" is a primary key for the table, but the question is how can I insert "orderid" in the insert statement in the procedure. I couldn't find any name sequence. There are 1230
    documents that must be inserted.
    Desc Gr_order
    Orderid  Number Primary key
    Desc     Varchar2
    INSERT INTO gr_order (orderid,desc)  
    VALUES (???, upper(each_pom.desc);
    Thank you
    Sandy

    You can find the code that inserts into the table and see if it uses the sequence ;-). A sequence is not 'attached' to a particular table - this is the insert statement to determine whether a sequence should be used.

    You can check if the table has a trigger - some developers like to emulate the behavior of MS - sql server by having a trigger on the table that selects in a sequence. If it has such a release, then you just do your insertions without specifying order_id. But if the table does not have such a release, then you cannot know if the table was originally filled using a sequence or not (unless you can find the instructions for inserting somewhere).

  • java.sql.SQLException: JDBC LLR, table check failed for the table ' WL_LLR_ADMI

    Hello

    I am trying to install OSB in a different domain. I already have a suite of soa running.

    This is the directory structure
    Middleware/user_projects/domains

    (a) soa_domain
    (b) osb_domain

    Who, from the administration server for the BSO, I get error below.


    Error: -.
    < server failed. Reason: Last forest resource [JTAExceptions:119002] failed during initialization. The server cannot start unless all configured logging last resource (LLRs) initialize. Fault reason:
    javax.transaction.SystemException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: check table JDBC LLR, failed for the table "WL_LLR_ADMINSERVER", line ' JDBC LLR field / / server ' record had an unexpected value ' soa_domain / / AdminServer' expected ' osb_domain / / AdminServer'* ONLY the domain and the server that creates a table original LLR can access *.



    I see the solution in https://blogs.oracle.com/epc/entry/technical_table_verify_failed_for but I have no doubt here.

    When I run

    Select RECORDSTR in the WL_LLR_ADMINSERVER where
    XIDSTR = "field of LLR JDBC / / server ';"

    I get the result like-> soa_domain / / AdminServer


    If I change it to osb_domain / / this AdminServer, will affect my soa_domain server... ? Please advice

    Published by: user10720442 on December 11, 2012 11:54

    Hello

    There are two possible solutions to this problem:

    Solution 1:

    To solve this problem reconfigures the basic information database of Point differently for each domain, if you have more than one domain. That, to change the port of the database and the name below two files in the field

    In the setDomainEnv.cmd (or .sh) file inside directory change DOMAIN_HOME/bin Point base port number and the name of the comic.

    Set POINTBASE_PORT = 9094
    Set POINTBASE_DBNAME = weblogic_eval2

    JDBC:PointBase:server://localhost:9094 / weblogic_eval2

    In the file wlsbjmsrpDataSource - jdbc.xml inside change DOMAIN_HOME/config/jdbc directory under entries with port of pointbase database updated and the name (this will be in two places in the file).

    Solution 2:

    If the domain name has been changed and do not want to change the database properties, then an update to the WL_LLR_ADMINSERVER table is possible:

    that is to say:
    Update SCHEMA_SAMPLE. Set RECORDSTR = WL_LLR_ADMINSERVER ' base_domain / / AdminServer' where XIDSTR = "JDBC LLR field / / server ';"

    Kind regards
    Kal

  • variable binding can be used for the table in an explicit cursor

    I have an application that accesses a table on several different servers. I created a ref for the slider cursor variable and a varchar2 variable to define my query. variable I_server is a parameter to my procedure. Is it possible to rewrite the v_query using bind variable for the table/Server? I have included below v_query.

    v_query: = "SELECT rp.usr_id, rp.sun_sft_cat, rp.sun_start, rp.sun_hrs," |
    "rp.mon_sft_cat, rp.mon_start, rp.mon_hrs, |
    "rp.tue_sft_cat, rp.tue_start, rp.tue_hrs, |
    "rp.wed_sft_cat, rp.wed_start, rp.wed_hrs, |
    "rp.thu_sft_cat, rp.thu_start, rp.thu_hrs, |
    "rp.fri_sft_cat, rp.fri_start, rp.fri_hrs, |
    "rp.sat_sft_cat, rp.sat_start, rp.sat_hrs, |
    "rp.sun_sft, rp.mon_sft, rp.tue_sft, rp.wed_sft, |
    "rp.thu_sft, rp.fri_sft, rp.sat_sft, nvl (ei.wip_permanent_sched_seq, 0) ' |
    'FROM ' | I_server | "rp, wip_emp_information ei, |
    'wes, wip_emp_status_type West wip_emp_status' |
    "WHERE rp.usr_id = ei.employee_id' |"
    "AND wes.employee_id = ei.employee_id' |"
    "AND wes.status_type = west.status_type' |"
    "AND west.description =" STOREKEEPER "' |"
    "AND wes.effective_date = (SELECT MAX (wes2.effective_date)' |)"
    "OF wip_emp_status EMTE.2 |
    "WHERE wes2.status_type = wes.status_type' |"
    "AND wes2.employee_id = wes.employee_id' |"
    (' AND wes2.effective_date < = trunc (SYSDATE))' |
    "AND wes.status = rp.wk AND"Y"= 1'; -wk = 1 is the schedule for next week

    Rp_sched_cursor OPEN FOR v_query;

    If your intention is to do this:

    v_query := 'SELECT rp.usr_id, rp.sun_sft_cat, rp.sun_start, rp.sun_hrs,' ||
    ' rp.mon_sft_cat, rp.mon_start, rp.mon_hrs,' ||
    ' rp.tue_sft_cat, rp.tue_start, rp.tue_hrs,' ||
    ' rp.wed_sft_cat, rp.wed_start, rp.wed_hrs,' ||
    ' rp.thu_sft_cat, rp.thu_start, rp.thu_hrs,' ||
    ' rp.fri_sft_cat, rp.fri_start, rp.fri_hrs,' ||
    ' rp.sat_sft_cat, rp.sat_start, rp.sat_hrs,' ||
    ' rp.sun_sft, rp.mon_sft, rp.tue_sft, rp.wed_sft,' ||
    ' rp.thu_sft, rp.fri_sft, rp.sat_sft, nvl(ei.wip_permanent_sched_seq, 0)' ||
    ' FROM ' || :b0 || ' rp, wip_emp_information ei,' ||      --- Note the bindvariable...
    ' wip_emp_status wes, wip_emp_status_type west ' ||
    ' WHERE rp.usr_id = ei.employee_id' ||
    ' AND wes.employee_id = ei.employee_id' ||
    ' AND wes.status_type = west.status_type' ||
    ' AND west.description = ''WAREHOUSE EMPLOYEE''' ||
    ' AND wes.effective_date = (SELECT MAX(wes2.effective_date)' ||
    ' FROM wip_emp_status wes2' ||
    ' WHERE wes2.status_type = wes.status_type' ||
    ' AND wes2.employee_id = wes.employee_id' ||
    ' AND wes2.effective_date <= trunc(SYSDATE))' ||
    ' AND wes.status = ''Y'' AND rp.wk = 1'; -- wk = 1 is next week's schedule
    
    OPEN rp_sched_cursor FOR v_query USING i_server;
    

    So the answer is: no, you can do that.

    But then, my question would be: why would you do that?
    I guess that you have many "different servers. A cursor on the server will not hurt you.

  • How can I exclude a level for the table of contents, but this amount as a bookmark?

    I know how to exclude a level for the table of contents (or rather include only levels I want to be included) and also how to create bookmarks from the table of contents entries, but how can I exclude a level for the table of contents, but always include it as a bookmark?

    Make 2 toc styles. One for the entries in the Bookmarks panel, you can generate a table of contents on the side of any page, and you must score in its definition to create bookmarks and other things that you use to build the table of contents for the visible part of your document to print. This should have unchecked the option create a bookmark in its definition.

  • Unable to display data from a csv file data store

    Hi all

    I'm using ODI 11 g. I'm trying to import metadata from a csv file. To do this, I have created physical and logical diagrams corresponding. Context is global.

    Then, I created a model and a data store. Now, after reverse engineering data store, I got the file headers and I changed the data type of columns to my requirement and then tried to view the data in the data store. I am not getting any error, but can't see all the data. I am able to see only the headers.

    Even when I run the interface that loads data into a table, its operation without error, but no data entered...

    But the data is present in the source file...

    Can you please help me how to solve this problem...

    Hi Phanikanth,

    Thanks for your reply...

    I did the same thing that you suggested...

    In fact, I'm working on the ODI in UNIX environment. So I went for the record separator on UNIX option in the files of the data store tab and now its works well...

    in any case, once again thank you for your response...

    Thank you best regards &,.

    Vanina

  • How to add the primary key for the table with the existing data?

    The table is already busy data. There was no primary key before, so for each column, there are some duplicate values.

    I want to add a new column, which should be of the integer data type and can automatically incremented, from 001. I tried with Oracle SQL Developer, but it says "ORA-01758: table must be empty to add mandatory (NOT NULL) column. How can I do? Thank you!

    Hello

    Look for the [ALTER TABLE | http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_3001.htm#sthref4803] command to find out how to add a column (step (1)) and a (step (3)) constraint to an existing table.

    For the step (2):

    CREATE SEQUENCE  employee_id_seq
    START WITH  1
    ;
    
    UPDATE  employee
    SET     id  = employee_id_seq.NEXTVAL;
    

    When you create a sequence, START WITH 1 is the default value, so that the line is not really necessary above... I've included just to show how you could start with any number you have chosen.

  • DSC-WX350 shows 'unable to display' remains after the withdrawal of the card photos

    I'm having a problem with the DSC-WX350 seeing "ghosts" of the pictures after having been withdrawn to a computer.

    If I pop the camera card, stick it in a card reader and move photos the camera on my computer, as soon as I put the card in the WX350 seem to see fake photos files moved: it acts as if they were still there (info, date taken, keeps in the County of photo, etc.) but only shows an error "Unable to display" gray.

    I then manually delete each erroneous entry manually. As you can imagine, making whenever I have move photos from your camera is a pain in the *. I've looked through all the folders on the card and see anywhere that would be markers of remains of file or something else because of this problem. Any ideas why this happens?

    (FYI, the card has been formatted freshly correctly before using it in the camera.)

    Thanks advance.

    Can anyone offer help?

    Per this message on the card need to be formatted, I made several times now to try to circumvent the problem: formatting through the camera, formatting through the computer, formatting the computer, then the camera... After each time the test photo, I take and then remove while the card is located on the computer returns an error "Unable to display the image" ghost once the card in the camera.

    This is ridiculous. I will not be manually re-deletion of photos I moved your device every single timejust to avoid this * error. What happens here?

  • Unable to display portions of the image

    Hi all

    I am writing an application that will take the images collected the SDCard (7 images) and internet (3 images), layers and display the result, there can be up to 10 stacked images.

    The main image is a JPG file with overlays in GIFs.  I have everything works correctly when the application is started.

    However, if I go to my configuration screen and change 1 location 2 location data sets, exit the configuration screen and save the configuration, I get the first layers bit display correctly, but the rest are not.  If I come back in the configuration a second time and change the location at 1, save and back out, no layer SDCard don't show, but are those of the internet.

    The odd part of all this, is that this behavior occurs only on my device (Tour 9630), not the Simulator (Tour 9630).

    Here is a relevant code snippet which seems to not work after a while:

    String filename;
    FileConnection fconn;
    InputStream input;
    
    // set all of the internal images
    try { // topo
       filename = var.path_SDcard + var.path_overlay + var.path_ovl_topo + pathdist + radar + var.fname_topo + dist + var.ext_jpg;
       fconn = (FileConnection)Connector.open(filename);
       if (fconn.exists()) {
          input = (InputStream) fconn.openInputStream();
          int size = (int)fconn.fileSize();
          byte[] data = new byte[size];
          input.read(data, 0, size);
          _topo = EncodedImage.createEncodedImage(data, 0, size);
       }
       fconn.close();
    }
    catch (Exception ioe) {
       add(new LabelField("Exception - Topo: " + ioe.getMessage()));
    }
    

    On the 2nd time in the evolution of the scene (or 3rd time to display), I get messages to exception on the screen (the layer JPG) covers the first 2 times.

    I'm not sure it's necessary, but I use a finally clause, and in it I add code to close the stream and connection I opened.  Usually it goes the way of

    If)

    try {}

    . Close();

    } catch (Exception e) {}

    }

    = null;

    }

    In this case, for example, an exception will mean that you do not close the connection to the file.  As you see "out of resources" I wonder if your device/Simulator is just miss something you release (say file connections).  Therefore I review my code and finally use everything stored.

  • ADF: How to get all rowKeys for the table displayed in the page

    Hello

    I have table "COMPANY" where the 'COMPANY_ID' column is the primary key. I created a page simple jspx with:

    (1) a text entry to accept new IDs of company

    (2) Insert button.

    (3) af:table which displays all available in "SOCIETY" company ID

    When the user tries to enter a company code that is already present in the table I want to compare with the keys of the row of the table displayed below and if it's an already existing, I would like to send a friendly message for the user and put an end to the movement.

    So, how to extract all line keys to compare?

    Thanks in advance.

    Here's a way to check if you use the OperationBinding exception class:

    operationBinding.execute ();

    If (! operationBinding.getErrors () .isEmpty ()) {}

    There is an error

    List errors = operationBinding.getErrors ();

    Browse the list of hollow and see if there is an exception of your restrictions

    }

Maybe you are looking for

  • Change details in another region

    Hello I opened an Apple ID to the Qatar, now, I moved to the India. I tried to change my region and credit/debit card details. I have no credit or debit at the time card to the Apple ID, so for now I want to use the account without any card using the

  • How to remove a forgotten password

    I had a password on the Bios before going into my vacation.When I came back I had to stop my password. What can I do?I love my computer and I would like you can help? Thank you

  • My computer is running hot whenever I play a game and stops

    When I play a game on the computer as Witcher2, the computer runs hot and then stops when I turn on it shows he got hot at 90 degrees. Can I do to prevent that from happening. Thanks for any help.

  • Convert old PageMaker files into files ID CC-2015.

    How can I download InDesign CS5 or CS6 my CC account? I need to convert old PageMaker files into my ID CC-2015 current files.

  • For self-registering approval workflow

    HelloI have a requirement where I have to develop a workflow approval for self-registration.My requirement is if the user type is used, the user doesn't have to go through approval, but if the user is entrepreneur, that they have to go to some user a