Max_day must not exceed return data

Version of Oracle, Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production

Hi gurus

Grateful if someone help out me. I have the following data samples:

Examples of data

Create the table max_count
(
max_day number (5),
age_from number (5),
age_to number (5),
batch_no number (5)
);

Insert into max_count
Select max_day 275, age_from 0, age_to 79 700 double batch_no
Union of all the
Select max_day 275, age_from 80, age_to 999 700 double batch_no
;

as with a reference
(
Select age_from 0, age_to 29, batch_no 700 max_day 5 double
Union of all the
Select age_from 0, age_to 29, batch_no 700 max_day 10 double
Union of all the
Select age_from 70, 79 age_to, 700 batch_no max_day 274 of the double
Union of all the
Select age_from 70, 79 age_to, 700 batch_no max_day 276 double
Union of all the
Select age_from 80, age_to 89, 700 batch_no, 75 max_day of the double
Union of all the
Select age_from 80, age_to 100, 700 batch_no 81 max_day of double
)
Select * reference;

The reference query result

AGE_FROM, AGE_TO, BATCH_NO, MAX_DAY

0                       29           700                5

0                       29           700                10

70                     79           700                274

70                     79           700                276

80                     89           700                75

80                     100           700                81

The query result of max_count

Select * from max_count;

MAX_DAY, AGE_FROM, AGE_TO, BATCH_NO

275                0                     79                   700

275                80                999                    700

Rules

Max_count table, we define rules against each batch_no, for example, batch_no 700, against the age range 0 ~ 79, max_day should be = < 275 in the reference table.

If you see the 4 rows in the reference table (filled with red) then MAX_DAY is greater than 275 against the age range 0 ~ 79, same thing happened with the last row of the table to reference as well.

Power required

AGE_FROM, AGE_TO, BATCH_NO, MAX_DAY

0                       29           700                5

0                       29           700                10

70                     79           700                274

80                     89           700                75

Thanks in advance.

Concerning

Shu

Same thing * not * occur with the last line of the table - at least not according to your rules.

Something like this:

as with a reference

(

Select age_from 0, age_to 29, batch_no 700 max_day 5 double

Union of all the

Select age_from 0, age_to 29, batch_no 700 max_day 10 double

Union of all the

Select age_from 70, 79 age_to, 700 batch_no max_day 274 of the double

Union of all the

Select age_from 70, 79 age_to, 700 batch_no max_day 276 double

Union of all the

Select age_from 80, age_to 89, 700 batch_no, 75 max_day of the double

Union of all the

Select age_from 80, age_to 100, 700 batch_no 81 max_day of double

)

Select * from reference d

where exists (select null

of max_count c

where d.batch_no = c.batch_no

and d.age_from between c.age_from and c.age_to

and d.age_to between c.age_from and c.age_to

and d.max_day<=>

Tags: Database

Similar Questions

  • Basic stored procedure helps - not the return data

    Hi all:

    To be fair, I come from a SQL Server environment and have never written anything for PL/SQL / Oracle before, this is my first attempt, so if nothing is better or more effective, please let me know. The immediate problem I'm having is, I have the following stored procedure, and all I want to do is return the data in the table, so that I can fill my DataSet in code. But when I run the code against this stored procedure, it still don't bring back any data (if I just do a standard "SELECT * FROM lkAllocation", I get the results, so I know data are there and the connection is good). If execution of the procedure in my window in Oracle SQL Developer (call PAYSOL.spallocationselectall ();), my results displays no data as well. What is the problem with this stored procedure?


    create or replace
    PROCEDURE spAllocationSelectAll IS
    Whole AllocationID;
    AllocationName Varchar2 (50);

    BEGIN
    AllocationID: = 0;
    AllocationName: = ";

    SELECT
    AllocationID,
    AllocationName
    IN
    AllocationID,
    AllocationName
    Of
    lkAllocation
    ORDER BY
    AllocationName;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    NULL;
    WHILE OTHERS THEN
    -Consider recording the error and then re-raise
    LIFT;
    END spAllocationSelectAll;

    Well, I'm not really in .net (I would participate in another forum so ;)), but this might be useful?

    Value (Oracle.DataAccess.Types)      System.Data.DbType      OracleDbType
    OracleRefCursor      Object      RefCursor
    

    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025379
    http://download.Oracle.com/docs/CD/B19306_01/win.102/b14307/featOraCommand.htm#g1025072

    Perhaps the [forum Windows and .net | http://forums.oracle.com/forums/category.jspa?categoryID=44] is worth a try as well.

  • Satellite A135-S4827 must not exceed 2 GB ram?

    I tried to replace one of the sticks of 1 GB with a 2 GB key; same brand and my computer does not start after. I took out the other 1 GB ram left the 2 GB of ram and my computer bed for 2 GB of ram. I took the 2 GB of ram and inserted the 1 GB of ram and my computer reads 1 GB of ram. I tried putting them together and my computer does not start. Someone knows why?

    Are you sure that your laptop supports more than 2 GB? I think that the chipset model number determines how you can install the RAM. To display chipset, run CPU - Z (google search)

    An update of the BIOS can help.

    Try to reinstall the two modules. If this does not work, clean the connections of the module memory with a pencil eraser.

    Also be careful with static electricity, computer parts low voltage with handling treadmill running shoes is not a good combination: P

  • On the forms send us and receive in return, data in the form of fields will be not print.  We can view the data, but the fields to print Virgin.  How can I fix it?

    On the forms send us and receive in return, data in the form of fields will be not print.  We can view the data, but the fields to print Virgin.  How can I fix it?

    OK, it's different. These text boxes are (at least engineering point of view) not considered form data, they are annotations (or markup). On your print dialogue box, you will see a group of "Comments & Form". Make sure that the first control is set to "Document and annotations:

    After this change, you should see the markup of your impressions.

  • Predefined VectorLayer do not return data

    Hello world

    I'm completely stumped. I'm trying to restore a theme preset using the HTML5 API of Oracle cards, and it is simply not appear as it is not all the data. I have a table defined as such, which traces the outline of a store manager:

    STORE_FLOOR_DATA

    --------------------------------------------

    NUMBER OF STOREID,

    NUMBER OF FLOOR,

    FUNCTION VARCHAR2 (50 BYTE),

    GEOM SDO_GEOMETRY

    Samples (note that I am using a 0-1.0 X / coordinate system, 0,0 in the bottom left of the blueprint and 1.1 top right.) I use-1 as an SRID:

    STOREID FLOOR FEATURE GEOM

    1 1 UP TO 5 SDO_GEOMETRY (2003, NULL, NULL, SDO_ELEM_INFO_ARRAY (1,1003,3), SDO_ORDINATE_ARRAY (0.25,0.25,0.5,0.5))

    I've added an entry in USER_SDO_GEOM_METADATA and created a spatial index on geom

    I've implemented my data source, in MapViewer and set the config as well:

    < name map_data_source = "nosql".

    jdbc_host = "localhost".

    jdbc_sid = "orcl".

    jdbc_port = "1521".

    jdbc_user = "nosqluser".

    jdbc_password = "ZoXpqdRt1hfmn/fISARJxgX2DXOQDn6r".

    jdbc_mode = 'thin '.

    number_of_mappers = '3 '.

    allow_jdbc_theme_based_foi = 'true '.

    Editable = "false".

    / >

    < mds_config >

    < name data_source = "nosql" >

    < allow_predefined_themes > true < / allow_predefined_themes >

    < allow_dynamic_themes > true < / allow_dynamic_themes >

    allow <>

    < subject > STORE_FLOOR_THEME < / theme >

    < / allow >

    < / data_source >

    < name data_source = "nosql" >

    < allow_predefined_themes > true < / allow_predefined_themes >

    < allow_dynamic_themes > true < / allow_dynamic_themes >

    < / data_source >

    < / mds_config >

    I then used mapbuilder to create the STORE_FLOOR_THEME theme, using the XML below:

    <? XML version = "1.0" standalone = "yes"? >

    < styling_rules >

    < hidden_info >

    < column field = "STOREID" name = "STOREID" / >

    < column field = 'FLOOR' name = 'FLOOR' / >

    < column field = "FEATURE" name = "FEATURE" / >

    < / hidden_info >

    < rule >

    < has style = "L.STORE_LINE" > < / feature > ""

    < / rule >

    < / styling_rules >

    The geometry column is, of course, the GEOM column.

    When previewing the theme in mapbuilder, it seems, all the rectangles are drawn as expected.

    I wrote a narrative view, and I've used the below some code to add the topic of the current map:

    var storeplan = new OM.layer.VectorLayer ("storeplan",

    {

    def:

    {

    type: OM.layer.VectorLayer.TYPE_PREDEFINED,.

    dataSource: "nosql"

    Theme: "store_floor_theme."

    URL: baseURL

    loadOnDemand: false

    }

    });

    Map1.addLayer (storeplan);

    I dragged on the STOREID, FLOOR and FEATURE columns in the analysis criteria.

    My problem is that the theme is not rendered in the view. When I look at firebug at the request of mapviewer, I see the following:

    {"type": "FeatureCollection",}

    "CollectionName": "store_floor_theme",

    "srs":-1,.

    'geodesics': false,

    "attr_names": [],.

    "attr_types": [],.

    "Features":]

    ]}

    Notice how, no data is retrieved in the theme (attr_names, attr_types, and features are all empty)? That is why it is not rendered, I guess. I have no active filter, and if I add a table view I see all rows returned as expected. For some reason, the theme itself thinks there is no geometry data to draw.

    Can someone explain to me why this is happening? I would be very grateful.

    Kind regards

    Richard

    Hi Renan,

    Sorry for the delay in response, I've been away.

    I managed to solve the problem in the end, it seems that he did not use-1 as an SRID, at the time when I changed it to something else like 8307, suddenly it worked. Since I am not a map of the world or making of distance calculations at the present time, it is not a major problem if viewing thinks that my clients are somewhere off the West coast of Africa. I need to understand what SRID in use thereafter however.

  • Between the operator on systimestamp do not return data

    create the table test_ts1 (timestamp);

    insert into test_ts1 values (systimestamp);

    insert into test_ts1 values (systimestamp-interval '1' time);

    commit;

    Select * from test_ts1 where one between systimestamp - interval '1' time and systimestamp;

    do not return data, could you please help? I would if necessary the param values.

    --

    Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    PL/SQL Release 11.2.0.2.0 - Production

    "CORE 11.2.0.2.0 Production."

    AMT for Linux: Version 11.2.0.2.0 - Production

    NLSRTL Version 11.2.0.2.0 - Production

    Thank you

    Mahesh

    2 options.

    1 convert your datatype of the column of TIMESTAMP WITH time ZONE SCHEDULE

    SQL > create table test_ts1 (a timestamp with time zone);

    Table created.

    SQL > insert into test_ts1 values (systimestamp);

    1 line of creation.

    SQL > insert into test_ts1 values (systimestamp-interval '1' time);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > select *.
    2 of test_ts1
    3 where one between systimestamp - interval '1' time and systimestamp;

    A
    ---------------------------------------------------------------------------
    MAY 19, 14 09.06.01.135799 AM - 04:00

    2 convert SYSTIMESTAMP TIMESTAMP.

    SQL > DROP TABLE TEST_TS1 IS SERVING;

    Deleted table.

    SQL > create table test_ts1 (timestamp);

    Table created.

    SQL > insert into test_ts1 values (systimestamp);

    1 line of creation.

    SQL > insert into test_ts1 values (systimestamp-interval '1' time);

    1 line of creation.

    SQL > commit;

    Validation complete.

    SQL > select *.
    2 of test_ts1
    3 where one between systimestamp - interval '1' time and systimestamp;

    no selected line

    SQL > select *.
    2 of test_ts1
    3 where one between Mount (systimestamp timestamp) - interval '1' time and cast (systimestamp timestamp);

    A
    ---------------------------------------------------------------------------
    MAY 19, 14 09.04.09.132503 AM

  • sys_refcursor do not fetch any data, even if the query returns the value

    I use sys_refcursor to return the columns and aid below the procedure to do. Although the data are there in table_1 and table_2.

    PROCEDURE test_pro (abc_date N, DATE,
    cur_get_data ON sys_refcursor
    )

    OPEN cur_get_data
    for
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    IF cur_get_data % rowcount = 0
    then
    raise e_error;
    END if;

    EXCEPTION
    When e_error
    then
    -no_data_found;
    while others
    then
    -(giving an error with the SQL error code);

    END test_pro;


    When running under sql in the sql pl/sql developer window pick
    data
    Select A.col1, B.col2
    from table_1 A
    where A.dis_date = abc_date
    left outer join
    table_2 B
    on
    A.dis_date = B.dis_date;

    But while testing the test_pro in the test of the pl/sql Developer window, it is
    do not fetch all data and raise e_error every time

    is there a problem arising from the use IF cur_get_data % rowcount = 0 whenever that happens in the exception block.

    so can someone please put a few ideas what cud be the reason for this?
    PROCEDURE test_pro(abc_date IN DATE,
                       cur_get_data OUT sys_refcursor
                      ) is
    BEGIN
    
      OPEN cur_get_data for select A.col1,B.col2
                              from table_1 A
                             where A.dis_date = abc_date
                                   left outer join
                                   table_2 B
                                on A.dis_date = B.dis_date;
    
    /* while testing let exceptions just pop out
    EXCEPTION
    
      when no_data_found
      then
    ------no_data_found;
      when others
      then
    --------(giving SQL error with error code);
    */
    END test_pro;
    

    then you test as something like

    declare
    
      my_date   date := to_date('20120621','yyyymmdd');
      my_cursor sys_refcursor;
      col1      ... ;
      col2      ... ;
    
    begin
    
      test_pro(my_date,my_cursor);
    
      loop
    
        fetch my_cursor into col1,col2;
        exit when my_cursor%notfound;
        dbms_output.put_line(col1 || ' ~ ' || col2);
    
      end loop;
    
    end;
    

    Concerning

    Etbin

  • return data to spark list itemrenderer

    Everyone is not how to return data from the itemrender for a spark list. say I had a checkbx in my itemrenderer how can we retrieve this info to my component principal if his selected or not. I looked on the datagrid itemeditor but I really use rather a spark list. Thank you

    Hello

    itemRenderer should be used only as RENDERER. All chenges must be made in the data.

    So if there is a check box, you must add click eventListener and change the property in the data to see whether he is selected.

  • JavaScript question - do not click on dates in a calendar

    We try on online tennis court booking site. When I click the calendar icon to select a date in the calendar, I can click on the date, but he does not at that date.

    Other browsers such as Chrome and Internet Explorer work fine. It just goes straight to the date I click.

    <"rel = 'nofollow' > http://demo3.onlinecourtreservations.com/Reservations.asp > demo version"

    <"rel = 'nofollow' > http://mum.onlinecourtreservations.com/Reservations.asp > our trial version."

    Here's what I sent to the developer and his answer is below.

    My Question: When you use the calendar for date selection tool, I noticed that it will not to the date on the calendar that I click. I can navigate using the arrows of day view and the view arrows week next to the icon of calendar very well.

    DEVELOPER RESPONSE: The calendar tool is based on javascript, so the security of your browser must allow scripts. To do this, the simplest method is to add your site to the "trusted sites" on your browser.

    The steps I've tried:
    1. the reset of the functionality of Firefox
    2. clear all history
    3. start in Safe Mode
    4. check to make sure that javaScript is enabled and it is.

    I wonder why this works fine in Chrome and Internet Explorer and not Firefox.

    Could someone help me solve the problem?

    Thank you.

    If you use this script, you can change it?

    The pop-up tries to submit a form hidden in the main window using a standard, old SEO method. You can correct the script in the pop-up window, or you can create a reference in the main window.

    Method #1:

    Change the code in the popup

    reservation_window.frmCalendar.submit();
    

    for this

    reservation_window.document.forms['frmCalendar'].submit();
    

    Method #2:

    In the main window, create a global script variable that creates the missing reference:

    window.frmCalendar = document.forms['frmCalendar'];
    

    Once solve you this problem, there is a new number. Web site empty, and when you view the source, you see that there is a problem with one of the hidden form parameters.

    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'CInt'
    /demo/common/reservationssheet/script.asp, line 25
    

    Since it is on the server, I don't know what goes wrong, but the script apparently don't deal well with a time value start missing. For what it's worth, I get the same error in IE8.

  • Tecra M5 does not record the date and time - battery RTC or CMOS checksum is inconsistent

    My Tecra M5 PTM50E reverend new does not record the date and time. I loaded RTC battery for 8 hours when electricity is on in the said user's manual. I don't know where is the problem. The BIOS settings are respect after power is on.

    When I change any value in the BIOS, the changes are saved properly but date & time system restored to their value 01/01/2000, 00:00 every time when I get out of turning off more of 2-3 min. Message "RTC battery is low or CMOS checksum is inconsistent.

    Press [F1] to set Date/time"does not appear when I power on the computer. Any suggestions?

    Hi guys

    Usually this problem appears only if the CMOS (real time clock) battery is empty or corrupted.
    The real time clock battery powers the internal clock in real time and calendar. It also maintains the system configuration. If the RTC battery is completely discharged, the system loses these data and the real-time clock. In this case, the message RTC battery is low or CMOS checksum is inconsistent appears.

    So I see only two possibilities:
    Either you will charge the battery for real-time clock, or you ask the technician for replacement.

    Generally, the battery must be completely charged after 8-9 hoers but try to connect the laptop to the power adapter for a long time.
    If it will not help solve the problem if you contact the ASP for the RTC battery replacement.

  • Error 1074395241: The model descriptor does not contain the data required for the corresponding rotation invariant.

    Hi all

    I use the model Match 4 IMAQ to detect the angle of rotation of an image of model. However, it displays the error: "error 1074395241: the model descriptor does not contain the data required for the corresponding rotation invariant." What exactly is the problem? How to solve this problem? The details are explained below.

    My project is a bit complicated. Part of the block diagram containing the IMAQ Match model 4 is illustrated below:

    The source image is a series of images of images read from an AVI video (I used a loop for to process the images frame by frame). The image of the model is an area of the first selected image. So, this means, the user selected the ineterst object in the first frame of the video, and each of the following images to find the object corresponding interest & determine its rotation angle. When I run the above diagram, there no error. However, it shows the angle of rotation zero no matter what it is 'really '. Therefore, I changed the schema by adding parameters, listed below:

    But in this case, when I run it, it shows the error I mentioned in the subject line.

    If you need more information about my project to identify the problem, please let me know.

    Thanks in advance.

    S ' Please example from model that comes with labview First
    Go to labview Help > find examples and you can search for example.
    -You create model with angle range and what kind of special criteria you want to use.
    -To do this you must use IMAQ learn pattern before using IMAQ model Match 4
    Reference:http://zone.ni.com/reference/en-XX/help/370281U-01/imaqvision/imaq_match_pattern_4/

  • now net.framework 2.0 spa 2 & 3.5 sp1 are not up-to-date.

    Original title: incident #SRX1156346212

    now net.framework 2.0 spa 2 & 3.5 sp1 are not up-to-date. Sorry for the delay to return to you, the first problem that still exists. Thanks again for any help. Michael

    Hello

    1. you receive an error message when trying to install these updates?
    2. What is the first problem are you referring to? Previous post the link to the thread.

    You can try to download and install the updates using the links below.
    http://www.Microsoft.com/download/en/details.aspx?ID=1639
    http://www.Microsoft.com/download/en/details.aspx?ID=22

  • Data tab returns data differently in different instances of SQL Developer

    On my instance of SQL Developer, when I click on the data tab, the data is returned immediately via a select * table query, but on one of the machines of my developer, when she clicks on the data tab, Developer SQL executes a select query * table... order in...

    The column it is order by is NOT indexed and the query takes a long time to return data.   We cannot understand where SQL Developer's store this particular query and associating it with the data on its instance SQL Developer tab.

    Anyone can shed some light?

    Right click on the grid, and then select "remove persisted settings...". »

  • ESXI 6.0 configuration problem: quick stats on {host} is not up-to-date

    I installed two Dell R530 3 days ago.

    Single-host, all right. The second appears in yellow on the Summary tab message: quick stats on {host} is not up-to-date

    Directly connected to the host shows no problem. The State of health is normal.

    Everything seems to work properly with respect to the collection of statistics.  But this yellow box annoys me

    I changed the settings, it works fine now.  In vSphere new its a little different look. You must add the word "config" in the key chain. It should look like this:

    config.vpxd.quickStats.HostStatsCheck

    config.vpxd.quickStats.ConfigIssues

    Enter the fields value: false

    Thank you

  • WARNING: Pellets of pga_aggregate_target 96 may not exceed memory_tar

    Hi all

    11.2.0.1
    OEL 6.4

    I am tracking our PROD alerts log and I can't occurrence of warnings:
    WARNING: pellets of pga_aggregate_target 96 may not exceed memory_target (101) - sga_target (0) or min_sga (6)
    I ignore this warning only? Does affect the performance?


    Thank you

    zxy

    Here's your on IE 6464 M 6.1 G memory_target and your pga_aggregate_target = 6174015488 which is about 6.1 G and your sga_max_target = 6.4 GB is.

    According to oracle documentation

    Make sure settings MEMORY_TARGET/MEMORY_MAX_TARGET are on at least the sum of SGA_MAX_SIZE/SGA_TARGET and the parameter PGA_AGGREGATE_TARGET

    Your memory_target must therefore more than sga_max_size + pga_aggregate_target

    That's why your target memory should be more than 6.4 + 6.1 = 12.5 G

    For example:

    ALTER system set memory_max_target = 13G scope = spfile;
    ALTER system set memory_target = 13g scope = spfile

    and restart the DB.

    Hope this can help you :)

    Published: sga_max_target to sga_max_size

Maybe you are looking for

  • What was the version prior to version 5?

    I want to know/download version before "version 5".

  • Satellite A660/07U - problem install the nVidia for Win 7 64 bit driver

    A660/07U Windows 7 64 bit At first, I need to install this driver because apparently it will solve a problem with the current driver that is causing the computer freezes when booting with an external monitor as main display. I downloaded the Setup fi

  • IMAQ light meter

    Hello I test an application that uses the meter IMAQ, in a loop at 60 Hz. (vision project) The memory usage increases over time, around 100 kb per minute. When I put a diagram disable around this meter, uses of memory remains constant in time (checke

  • 15 - f162dx: virtualization technology

    OK, so it's not my computer... but I wish it were! I have a quick survey on the computer laptop 15-f162dx HP. My first is this computer has virtualization technology? I would like to run the latest Windows 10 VMs as well as some older VMs to experime

  • I tunes has detected a problem in your audio configuration

    I see the MSG following when I try to play music from Itunes or other sounds on my Windows XP, PC, "I tunes has detected a problem with your audio config."  Audio/video playback may not work correctly.  I already follow a chain which led to remove me