Filtering the records returned in a group

I previously used to filter records:
<?-foreach: (current group) [. / COURSE_ORDER > 13]? >

This takes care with 'and' or 'between '? Need to pull a specific range, but do not know what syntax works
That is to say.
<?-foreach: (current group) [. / > 13 COURSE_ORDER] and [. / COURSE_ORDER < 100]? >

Check like that...

13 and COURSE_ORDER<>

Thank you
Ananth

Tags: Business Intelligence

Similar Questions

  • Explain the rows returned in a group plan of

    I have a (select statement) that returns 18 rows.

    wrap a select statement that is nested in a group by around it

    Select col_a, col_b of
    (select statement)
    Group of col_a, col_b

    Returns even 18 rows as expected

    explain that she and I see the 18 rows returned to Id 2 and the Group hash by, and then select lines 1.
                        
    ------------------------------------------------------------------------------------------------------------------------------------------------------                              
    | Id  | Operation                                   | Name                           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |                              
    ------------------------------------------------------------------------------------------------------------------------------------------------------                              
    |   0 | SELECT STATEMENT                            |                                |     1 |    95 |       | 90897  (75)| 00:00:02 |       |       |                              
    |   1 |  HASH GROUP BY                              |                                |     1 |    95 |       | 90897  (75)| 00:00:02 |       |       |                              
    |   2 |   VIEW                                      |                                |    18 |  1710 |       | 90896  (75)| 00:00:02 |       |       |        
    reason Im asking is I rewrote the SQL code in the internal instruction for adjustment purposes and I get even 18 rows as expected but now I have 2 lines referred to the hash group by.
    -----------------------------------------------------------------------------------------------------------------------------------------------------                               
    | Id  | Operation                                  | Name                           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     | Pstart| Pstop |                               
    -----------------------------------------------------------------------------------------------------------------------------------------------------                               
    |   0 | SELECT STATEMENT                           |                                |     2 |   190 |       | 82657  (80)| 00:00:02 |       |       |                               
    |   1 |  HASH GROUP BY                             |                                |     2 |   190 |       | 82657  (80)| 00:00:02 |       |       |                               
    |   2 |   VIEW                                     |                                |    18 |  1710 |       | 82656  (80)| 00:00:02 |       |       |                               
    ..
    ..
    In regards to plans above that "lines" means for the hash group by.

    These are just estimates, not actually the rows returned.

    Sometimes, you can make this small change and a kind of funny the optimizer calculation may change.

    But that's just an estimate.

  • Using the query with filtering the records

    I have a requirement with table and all of the following data
    create table test_sty 
    ( a_id number, s_txt varchar2(33), rank_cd varchar2(33), rank_sym_cd varchar2(33),
    c_cd varchar2(33), d_date date, o_cd varchar2(33), a_rank_id number, i_id number, i_det_id number,
    c_txt varchar2(33), d_txt varchar2(33), a_name varchar2(33), a_typ_id number, m_id number, r_cat_cd varchar2(33),
    r_sec_cd varchar2(33), r_sub_cd varchar2(33), c_link number
    )
    
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    200, ' Y_UTY', 'SH', 'B+', null,  sysdate
    , 'NA', 497, 978, 5098, '74C1', 'CP', 'U_L', 1, 101, 'P_H', 'GO', 'NA', 12); 
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    200, ' Y_UTY  ', 'SH', 'B+', null,  sysdate
    , 'NA', 497, 978, 5098, '74C1', 'CP', 'U_L', 1, 101, 'P_H', 'GO', 'NA', 12); 
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    100, ' Y_CUTY  ', 'SL', 'BC', null,  sysdate
    , 'STL', 427, 529, 9409, '245', null, 'U_L', 1, 101, 'P_H', 'GO', 'NA', 24); 
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    100, ' Y_CUTY  ', 'SL', 'BC', null,  sysdate
    , 'STL', 427, 565, 1567, '285', null, 'U_L', 1, 101, 'P_H', 'GO', 'NA', 24); 
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    300, ' Y_CUTY  ', 'SL', 'BC', null,  sysdate
    , 'STL', 427, 728, 1864, 'B34', null, 'U_L', 1, 101, 'P_H', 'GO', 'NA', 24); 
    insert into test_sty ( a_id, s_txt, rank_cd, rank_sym_cd, c_cd, d_date, o_cd, a_rank_id, i_id,
    i_det_id, c_txt, d_txt, a_name, a_typ_id, m_id, r_cat_cd, r_sec_cd, r_sub_cd,
    c_link ) values ( 
    300, ' Y_CUTY  ', 'SH', 'BC', null,  sysdate
    , 'STL', 427, 873, 1218, '74U', null, 'U_L', 1, 101, 'P_H', 'GO', 'NA', 24); 
    The requirement is to a_id may rank_cd = (SL and SH) OR (SL only)
    but he shouldn't have rank_cd= HS only

    A_ID = 200 RANK_CD = "SH" and this allowance A_ID = 200, it has a record with RANK_CD = SL
    If such records should be removed from the selection list

    For A_ID = 100 RANK_CD = 'SL' (even if it's not have SH, it can be allowed)
    For A_ID = 300 RANK_CD = 'SL' AND SH, so it can be allowed
    Expected Output 
    a_id in( 100,300)
    After the abvoe filtering condition, I need display all the columns in the table.

    Could you help me with this

    Published by: Smile on July 20, 2012 06:14
    /* Formatted on 7/20/2012 5:17:37 PM (QP5 v5.139.911.3011) */
    SELECT *
      FROM tesT_sty
     WHERE A_ID IN (SELECT DISTINCT (A_ID)
                      FROM tesT_sty
                     WHERE RANK_CD = 'SL');
    
  • Filtering the records of MDB

    I have a client who wants to filter records in the MDB... It should work as a point of view in DB or an array type select in the physical layer... choose * where Type = 6.

    Problem is that he can't or he wouldn't have the physical layer.

    The only way I can see for this to the MDB is when you map the logical physical column column, in the expression to a CaseIf Type = 6, map... I have to do this for each column... am I right?

    Pls. y at - it another way to do... easier?

    TXS for any help.
    Antonio

    Use where clause contained in the tab content of the logical table source properties.

    No need for any more.

    Mark correct/good so pls help

  • Thunderbird says it can't find the records that my message filters use and are present in the list of folders.

    The error message reads:

    The record [which] is not found, then the filters associated with this file will be disabled. Verify that the folder exists, and that the filters to point to a valid destination folder.

    If I manually edit the disabled message rules and try a mail run, the same error messages come up.
    

    I have the problem solved. The database of the service provider Internet Mozilla for some reason any returns the name of the server 'imap.gmail.com' when the account is set up in Thunderbird.

    Manually configure as "photoscape", and filters work very well.

  • FRM-30187: size of the column of type CHAR in the record group must be between 1 and 2000.

    Hi, forms 6i, db 10g

    I created a lov based on this query

    select * from items_qty_vu -- database view
    

    and the view code is

    CREATE OR REPLACE FORCE VIEW items_qty_vu (serial, item_id, expiry_date, qty)
    AS
       WITH item_units_plus AS
            (SELECT item_id, unit_id, factor,
                    LEAD (factor, 1, 1e99) OVER (PARTITION BY item_id ORDER BY factor)
                                                                   AS next_factor,
                    ROW_NUMBER () OVER (PARTITION BY item_id ORDER BY factor DESC)
                                                                           AS rnk
               FROM item_units)
       SELECT     ID.serial, ID.item_id, ID.expiry_date,
                  SUBSTR
                     (SYS_CONNECT_BY_PATH (   TRUNC (  MOD ((  ID.qty
                                                             - ID.qty_allocated
                                                            ),
                                                            iup.next_factor
                                                           )
                                                     / iup.factor
                                                    )
                                           || ' '
                                           || u.unit_name,
                                           ', '
                                          ),
                      3
                     ) AS qty
             FROM item_detail ID JOIN items i ON i.item_id = ID.item_id
                  JOIN item_units_plus iup ON iup.item_id = ID.item_id
                  JOIN units u ON u.unit_code = iup.unit_id
            WHERE CONNECT_BY_ISLEAF = 1
       START WITH iup.rnk = 1
       CONNECT BY iup.rnk = PRIOR iup.rnk + 1 AND ID.serial = PRIOR ID.serial
         ORDER BY ID.serial;
    
    

    When I compile the form, I face the error FRM-30187,

    If I replace my query "select * from items_qty_view" with "select item_id, serial, expiry_date of items_qty_vu", it compiles successfully.

    As salamualikum, Salem,.

    You must follow my instructions carefully.

    1. Select the record group.

    2. go in the record group property

    3. Select and open the column specifications

    4. highlight the column and check the decrease of the length, the bellows of the size that you cross more than 2000 then 2000.

    Compilation of now and you're done.

    Wow. you did.

    Hamid

  • Add a string when the query returns all records

    DB version: 11.2

    create table t (empname varchar2 (25), salary number, varchar2 (20) months, number of over_time);

    insert into values t ('JOHN', 2000, "NOVEMBER2014", 0);

    insert into values t ('KATE', 2000, "NOVEMBER2014", 300);

    insert into values t ('HANS', 5000, "NOVEMBER2014", 100);

    insert into values t ("KRISHNA", 2500, "NOVEMBER2014", 0);

    insert into values t ("SIEW", 3000, "NOVEMBER2014", 0);

    commit;

    SQL > select * from t;

    EMPNAME MONTHS SALARY OVER_TIME

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

    JOHN 2000 NOVEMBER2014 0

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    KRISHNA 2500 NOVEMBER2014 0

    SIEW 3000 NOVEMBER2014 0

    SQL > select * from t where MONTH = 'NOVEMBER2014' and OVER_TIME! = 0 ;

    EMPNAME MONTHS SALARY OVER_TIME

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

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    What I need is:

    If the query above returns at least one record, it should display the line ' Yes. We have one or more employees who worked overtime in November2014'

    before the documents are printed

    Thus, the expected production is

    Yes. We have one or more employees who worked overtime at the November2014

    EMPNAME MONTHS SALARY OVER_TIME

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

    KATE 2000 NOVEMBER2014 300

    HANS 5000 NOVEMBER2014 100

    If the query returns no records then usual 'no rows selected' isn't enough

    Lothar G.f. says:

    In fact, sql * more is no good tool for use considered.

    Really?  It may be a good reporting tool if you learn to use it as such...

    for example

    SQL > ttitle left 'Yes. We have one or more employees who worked overtime in November2014.
    SQL > select * from emp where empno = 1234;

    no selected line

    SQL > select * from emp where empno = 7788;

    Yes. We have one or more employees who worked overtime at the November2014
    EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR
    ---------- ---------- --------- ---------- -------------------- ---------- ---------- ----------
    7788, SCOTT, ANALYST, 7566 19 APRIL 1987 00:00:00 3000 20

    This is just a basic example.  It is possible to get SQL * more to ask for the required criteria and that the title could adjust according to this criterion, as well as the query building on it also.

    However, the OP did not specify SQL * as the reporting tool, so there is little interest providing a complete solution which, until they specify what user interface that they are actually using.

  • Move to the record of the groups now

    I work in form 11g and using the webUtil version that was included with it. I just do my development by remoteing directly on the server because it is easier that develop on my computer the compilation and then sending to the server and then compile again until I can use it and the server runs on Windows Server 2003 SP2.

    For those of you who have not until this follow-up to my posts, I'm working on the use of webUtil to create buttons to upload/download on one of the forms of our program. I FINALLY got webUtil set up and got the part of download works now I am trying to enter the download, I try firstly set up a way to show the user which was transferred to the table (not the actual blob or anything like that just the document filename ID etc) so they can select which file they want to download it to their computer , I tried to do this as well by creating a drop-down list and put the ID doc in that and also just by clicking on the button and pulling it upward a LOV the user to pic and in both cases he works not. The problem, I am running, at least for now, is that somehow it is not able to fill the record, I know that, I just can't understand what may not be correct with the record group... the only properties in the record group is the name of it, the query that fills the size of the extraction and the columns, the query throws an error as soon as you click on that property if there is nothing wrong with that, columns are practically filled auto of forms and the size of the extraction I tried almost all values between 0 and 100, nothing helps.

    The query I use is:

    SELECT ANNUAL, FILENAME
    DOCUMENTATION
    WHERE ANNUAL IS NOT NULL
    ORDER BY ANNUAL CSA

    but when I try to run the program I get a FRM 41076: error group filling. Followed by a FRM 40502: ORACLE error: cannot read the list of values. Of course, he cannot read the list of values there is no value to read because the record group has not been filled.

    Please any help on this is greatly appreciated. The wonderful people of this forum have been absolute rescuers so far on my quest to get this program to work despite the better to keep me from succeeding.
    SELECT DOC_ID, FILENAME
    

    DOCUMENTATION
    WHERE ANNUAL IS NOT NULL
    ORDER BY ANNUAL CSA

    What happens when you run your query more SQL, TOAD, etc.?

    Your table is created in the schema JLIM. This user are you connected to forms with? If it is not the user JLIM, then you will need to reference the table in your query using the schema owner. FOR EXAMPLE:

    SELECT DOC_ID, FILENAME
    FROM jlim.DOCS
    WHERE DOC_ID IS NOT NULL
    ORDER BY DOC_ID ASC
    

    If this table will be used frequently by your form application, you can eliminate the need to fully qualify your table by creating a public synonym to the table.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • change the record group for a lov

    Dear Sirs,
    I have a list of value (LOV) and I have 2 record group, and I want to associate each of these group record depends on the conidition
    for example

    If condition 1
    associate the record group 1 LOV
    on the other
    associate the record group 2 LOV
    end if;

    Please help me
    Thanks in advance

    Check the built-in SET_LOV_PROPERTY, you can use this then assign a recordgroup to a lov.

  • Fill area of the screen with the first value in the record group

    Hi guys, what the title essentially says. I have a display element that is populated by the by selecting the appropriate option in a LOV. Is there a method that I can put in when a new instance of the form or something else to fill the screen with the first item in the record group used to fill the lov to ensure when the load form display area is not empty. I know I have to hard just in code, but I would have the value come from the record group.


    Thank you

    Published by: user13390506 on August 25, 2010 05:39

    This works very well for me:

    Created a record group (RG1) with the following order of selection:

    select table_name, table_name from user_tables order by 1
    

    Created a button on the Web that are running the following:

    PROCEDURE pop IS
       rg_id RecordGroup;
       gc_id GroupColumn;
       col_val VARCHAR2(1000);
       n number ;
    BEGIN
    
       rg_id := Find_Group( 'rg1' ); 
    
       IF Id_Null(rg_id) THEN
       Message('Record Group rg1 does not exist.');
       RAISE form_trigger_failure;
       END IF; 
    
       n := Populate_Group( rg_id) ;
       gc_id := Find_Column( 'RG1.TABLE_NAME' ); 
    
       IF Not Id_Null(gc_id) THEN
         col_val := GET_GROUP_CHAR_CELL( gc_id, 1 );
         message(col_val);
       End if ;
    
    End;
    

    I guess the record_name.column_name at the top of case...

    François

  • How to share the record group between 2 forms

    Hi all

    Some might guide me how to send one record group to another form and how it is received

    programmaticaly

    any help or advice, that I enjoyed

    Thank you

    Hello
    Little late but was not on the development computer.
    In fact the data you are trying to recover also ensure the data type. I mean if you retrieve DIGITAL data record group for the first column you use fld_1 , you must have to use the built-in GET_GROUP_NUMBER_CELL . Like this..

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
       :ctrl.text_item8 := GET_GROUP_NUMBER_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    If If the field you get the record group's CHARACTER then you must use the built-in function GET_GROUP_CHAR_CELL like that...

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
        :ctrl.text_item8 := GET_GROUP_CHAR_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    And if the salvage value of DATE data type, then GET_GROUP_DATE_CELL like this...

    DECLARE
      rg_id recordgroup;
    BEGIN
      rg_id := FIND_GROUP('my_rg');
      IF NOT id_null(rg_id) THEN
        :ctrl.text_item8 := GET_GROUP_DATE_CELL('my_rg.fld_1', 1);
      END IF;
    END;
    

    So, in you case I think the department_id data type is numeric in the database, and you use GET_GROUP_CHAR_CELL which will not work. Use the first one I showed you for numeric values.

    And also use the trigger a TIME NEW FORM INSTANCE used to retrieve the value. I want to use the first example in this trigger. Then you can see the value of the result of the shared record group.

    -Clément

  • Updated content item highlight when execute the query returns records to prevent

    Hello

    I use form 10g and I was wondering if it is possible to achieve the effect shows:

    The performance of a query for a block of data in data table, the content / the value of the first element in the first record returned is always highlighted. Is it possible to prevent this highlighting, and simply place the focus of the cursor on the 'start' of the field before the first character of the value of the element. Thanks in advance for any suggestions,

    Kind regards

    Kevin.

    Keep the position of the cursor to Yes Dungeon.
    Right after the call to the build-in execute_query try a synchronization;

  • Return only the records with a string of text that is less than a certain value?

    Hi people,

    I'm not sure whether this is possible or not, but worth-

    I need to be able somehow output only the lines with the text of a column field less to (because of the arguments) 30 characters (including spaces). I know that I can use CFs Left() function to cut the chain, but I don't want to have words cut off mid-sentence. Therefore, I want to somehow restrict the query to only the records that contain a string of less than 30 characters.

    Is this possible?

    Thanks in advance :-)

    You can use the length of the db function. It may or may not be named LEN()

    SELECT SomeColumn
    FROM YourTable
    WHERE LEN (SomeColumn)<=>

    Or you can retrieve all of the records and use one of the functions of the chain at cflib.org as FullLeft().
    http://www.cflib.org/UDF.cfm?id=329

  • Overview and details of the records in the same mixing ratio

    Hello, on the bottom I need to mix the results in the summary table and the records in the table of details in the same report.

    To create the scenario:
    CREATE TABLE ALPHA
    (
    ALPHA_ID     NUMBER,
    ALPHA_NR     NUMBER,
    ALPHA_TOTCT     NUMBER,
    ALPHA_FUND     NUMBER
    
    );
    
    ALTER TABLE ALPHA ADD (
         CONSTRAINT ALPHA_PK PRIMARY KEY (ALPHA_ID));
    ALTER TABLE ALPHA ADD (
         CONSTRAINT ALPHA_NR_UNI UNIQUE (ALPHA_NR));
    
    
    INSERT INTO ALPHA(ALPHA_ID, ALPHA_NR)
    VALUES( 1, 7 );
    INSERT INTO ALPHA(ALPHA_ID, ALPHA_NR)
    VALUES( 2, 11 );
    INSERT INTO ALPHA(ALPHA_ID, ALPHA_NR)
    VALUES( 3, 15 );
    INSERT INTO ALPHA(ALPHA_ID, ALPHA_NR)
    VALUES( 4, 17 );
    
    CREATE TABLE HIST
    (
    HIST_ID     NUMBER,
    HIST_NR NUMBER,
    HIST_ALPHA_NR NUMBER,
    HIST_CT          NUMBER,
    HIST_VAL     NUMBER,
    HIST_DATE     DATE
    
    );
    
    ALTER TABLE HIST ADD (
         CONSTRAINT HIST_PK PRIMARY KEY (HIST_ID));
    ALTER TABLE HIST ADD (
         CONSTRAINT HIST_NR_UNI UNIQUE (HIST_NR));
    ALTER TABLE HIST ADD (
         CONSTRAINT HIST_ALPHA_NR_FK FOREIGN KEY (HIST_ALPHA_NR) REFERENCES ALPHA ( ALPHA_NR ) );
    
    TRUNCATE TABLE HIST;
    
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 1 ,1    ,7 ,1 ,10 , TO_DATE('01.02.2009' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 2 ,6    ,7 ,1 ,10 , TO_DATE('01.05.2009' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 3 ,3    ,7 ,3 ,30 , TO_DATE('01.02.2010' , 'dd.mm.yyyy' ) );
    
    
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 4 ,4    ,11 ,1 ,10 , TO_DATE('01.03.2009' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 5 ,5    ,11 ,-2 ,-20 , TO_DATE('01.06.2010' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 6 ,8    ,11 ,1 ,10 , TO_DATE('01.02.2011' , 'dd.mm.yyyy' ) );
    
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 7 ,2    ,15 ,2 ,20 , TO_DATE('01.03.2009' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 8 ,7    ,15 ,5 ,50 , TO_DATE('01.06.2010' , 'dd.mm.yyyy' ) );
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 9 ,9    ,15 ,-4 ,-40 , TO_DATE('01.02.2011' , 'dd.mm.yyyy' ) );
    
    INSERT INTO HIST( HIST_ID ,HIST_NR ,HIST_ALPHA_NR ,HIST_CT ,HIST_VAL ,HIST_DATE )
    VALUES ( 10 ,10    ,17 ,1 ,10 , TO_DATE('01.03.2011' , 'dd.mm.yyyy' ) );
    To update the summary table, I used a view
    CREATE OR REPLACE VIEW HIST_AGG ( HIST_ALPHA_NR,  TOT_CT  , TOT_VAL )
    AS
    SELECT HIST_ALPHA_NR
    ,SUM ( NVL(HIST_CT, 0 ) ) TOT_CT
    ,SUM( NVL(HIST_VAL, 0) )  TOT_VAL
    
    FROM HIST
    GROUP BY HIST_ALPHA_NR;
    
    
    DECLARE
    
    CURSOR cur
    IS
    SELECT
    HIST_ALPHA_NR
    ,TOT_CT
    ,TOT_VAL
    FROM HIST_AGG
    ;
    
    BEGIN
    FOR rec IN cur
    LOOP
    
         UPDATE ALPHA
         SET ALPHA_TOTCT = rec.TOT_CT
         , ALPHA_FUND  = rec.TOT_VAL
         WHERE ALPHA_NR = rec.HIST_ALPHA_NR;
    
    END LOOP;
    
    END;
    First report should the line overview Alpha tracked table of all the detail records of
    HIST table and for each alpha_nr. At the end of report total overview
    alpha of the table.
    "SUMMARY";"ALPHA_NR";"ALPHA_TOTCT";"ALPHA_FUND";
    ;;;;
    ;7;5;50;
    ;7;1;10;01.02.2009
    ;7;1;10;01.05.2009
    ;7;3;30;
    ;11;0;0;
    ;11;1;10;01.03.2009
    ;11;-2;-20;01.06.2010
    ;11;1;10;01.02.2011
    ;15;3;30;
    ;15;2;20;01.03.2009
    ;15;5;50;01.06.2010
    ;15;-4;-40;01.02.2011
    ;17;1;10;
    ;17;1;10;01.03.2011
    "TOTAL_ALPHA_NR";4;9;90;
    Second report should display the overview by period (year), but the timeline
    for example the year 2009 begins from the year 2010. At the end of each year a summary for
    the current state.
    "YEAR";"ALPHA_NR";"ALPHA_TOTCT";"ALPHA_FUND"
    ;;;
    2009;7;0;0
    ;11;0;0
    ;15;0;0
    ;17;0;0
    "Total 2009";4;0;0
    2010;7;2;20
    ;11;1;10
    ;15;2;20
    ;17;0;0
    "Total 2010";4;5;50
    2011;7;5;50
    ;11;-1;-10
    ;15;7;70
    ;17;0;0
    "Total 2011";4;11;110
    2012;7;5;50
    ;11;0;0
    ;15;3;30
    ;17;1;10
    "Total 2012";4;9;90

    Hello

    wucis wrote:
    I now use this selection

    ...
    FROM       hist        h
    ,       alpha        a
    WHERE       h.hist_alpha_nr (+)     = a.alpha_nr
    AND       a.active          = 'Y'
    AND a.alpha_nr >=  NVL ( NULL  , 1 )
    AND a.alpha_nr <=  NVL ( NULL  , 10000 )
    AND a.alpha_date >= NVL ( TO_DATE( '02.01.2008'  , 'dd.mm.yyyy' ) , '01.01.2000' )
    --AND h.hist_date  >= NVL ( TO_DATE( NULL  , 'dd.mm.yyyy' ) , '01.01.2000' )
    --AND h.hist_date <= NVL ( TO_DATE( NULL  , 'dd.mm.yyyy' ) , '02.02.2222')
    ...
    

    The problem is now, if I limit the query about the h.hist_date, the lines disappear when there is no entry in HIST for this ALPHA_NR,
    in particular the line with alpha_nr = 12 disappears.

    When you use the old notation join, outer join, whenever a column of a table is marked with the + sign, then all the conditions in the WHERE clause that references the same table need a sign +. Otherwise, the effect is identical to an inner join.
    Using the old syntax, you must say something like:

    ...
    FROM       hist        h
    ,       alpha        a
    WHERE       h.hist_alpha_nr (+)     = a.alpha_nr
    AND       a.active          = 'Y'
    AND        a.alpha_nr          >=  1
    AND        a.alpha_nr           <=  10000
    AND        a.alpha_date           >=  TO_DATE ('01.01.2000', 'dd.mm.yyyy')
    AND        h.hist_date (+)     >=  TO_DATE ('01.01.2000', 'dd.mm.yyyy')
    AND       h.hist_date (+)     <=  TO_DATE ('02.02.2222', 'dd.mm.yyyy')
    ...
    

    Notice the + sign in the last 2 lines, after the columns in this table of reference h. I find the ANSI join syntax much more clear in this case.

    How you use NVL makes no sense. NVL (NULL, x) returns x, no matter what x is.
    What you trying to do? Perhaps you meant

    AND        NVL (a.alpha_nr, 1)          >=  1
    
  • How to choose the lowest value of the record

    I would return the lowest bidder of the recording of the same rental date and call number.
      SELECT   v.vendor "Vendor Id", INITCAP (v.vnames) "Vendor Name", B.DATELET "Letting Date" ,d.call "Call Number",
                      TO_CHAR (d.calcbtot, '$99,999,999.99') AS "Bidders Estimate",
                      TO_CHAR (SUM (q.qty * q.price), '$99,999,999.99')
                                                                       AS" Enginers Estimate"          
                    
                 FROM letprop l,
                      proposal p,
                      propitem q,
                      bidlet b,
                      bidtabs c,
                      itemlist i,
                      vendor v,
                      bidders d
                WHERE (l.letting = b.letting)
                  AND b.letting = c.letting
                  AND p.cspecyr = i.ispecyr
                  AND q.prpitem = i.item
                  AND p.contid = l.lcontid
                  AND q.contid = p.contid
                  AND c.vendor = l.avendor
                  AND l.CALL = c.CALL
                  AND q.lineflag = c.lineflag
                  AND q.iplineno = c.iplineno
                  AND l.letting = d.letting
                  AND c.letting = l.letting
                  AND c.CALL = d.CALL
                  AND c.letting = d.letting
                  AND v.vendor = d.vendor
                  AND l.letstat = 'A'
                  AND  b.datelet  between to_date ('2007/01/01', 'yyyy/mm/dd')    AND to_date ('2011/12/31', 'yyyy/mm/dd')
             GROUP BY v.vendor, v.vnames, d.calcbtot, (d.calcbtot / l.contamt), B.DATELET, d.call
             ORDER BY b.datelet, "Bidders Estimate";
    Vendor Id     Vendor Name     Letting Date     Call Number     Bidders Estimate      Enginers Estimate
    K0030              Interstate Improvement Inc     01/26/2007 00:00:00     009         $190,601.40         $209,895.00
    M110               Mankato Electric Inc     01/26/2007 00:00:00     015         $216,790.00         $213,000.00
    C470               Collisys     01/26/2007 00:00:00     015         $222,426.00         $213,000.00
    K110               Killmer Electric Co Inc     01/26/2007 00:00:00     015         $223,386.00         $213,000.00
    E110               Egan Company      01/26/2007 00:00:00     015         $225,740.00         $213,000.00
    G0034              Granite Ledge Electrical Contractors Inc     01/26/2007 00:00:00     015         $226,750.00         $213,000.00
    B500               Carl Bolander & Sons Co     01/26/2007 00:00:00     014         $227,227.00         $274,104.98
    M0069              Mattison Contractors Inc     01/26/2007 00:00:00     014         $231,340.03         $274,104.98
    T0041              Three Rivers Construction Inc     01/26/2007 00:00:00     014         $237,623.00         $274,104.98
    M110               Mankato Electric Inc     01/26/2007 00:00:00     012         $238,971.20         $253,700.00
    R290               Ridgedale Electric Inc     01/26/2007 00:00:00     015         $247,900.00         $213,000.00
    desired out put is this one.
    
    K0030              Interstate Improvement Inc     01/26/2007 00:00:00     009         $190,601.40         $209,895.00
    M110               Mankato Electric Inc     01/26/2007 00:00:00     015         $216,790.00         $213,000.00
    B500               Carl Bolander & Sons Co     01/26/2007 00:00:00     014         $227,227.00         $274,104.98

    Maybe this? I used the dense rank as if two bidders have bid even then both of them will be selected. If you just want one, replace it with row_number()

    SELECT * FROM (
    SELECT v.vendor "Vendor Id",
           INITCAP (v.vnames) "Vendor Name",
           B.DATELET "Letting Date",
           d.CALL "Call Number",
           TO_CHAR ( d.calcbtot, '$99,999,999.99') AS "Bidders Estimate",
           TO_CHAR ( SUM (q.qty * q.price), '$99,999,999.99')
             AS " Enginers Estimate",
           DENSE_RANK ()
           OVER (
             PARTITION BY v.vendor,
                          v.vnames,
                          d.calcbtot,
                          (d.calcbtot / l.contamt),
                          B.DATELET,
                          d.CALL
             ORDER BY TO_CHAR ( d.calcbtot, '$99,999,999.99') ASC
           )
             RN
      FROM letprop l,
           proposal P,
           propitem q,
           bidlet b,
           bidtabs c,
           itemlist i,
           vendor v,
           bidders d
     WHERE (l.letting = b.letting)
       AND b.letting = c.letting
       AND P.cspecyr = i.ispecyr
       AND q.prpitem = i.item
       AND P.contid = l.lcontid
       AND q.contid = P.contid
       AND c.vendor = l.avendor
       AND l.CALL = c.CALL
       AND q.lineflag = c.lineflag
       AND q.iplineno = c.iplineno
       AND l.letting = d.letting
       AND c.letting = l.letting
       AND c.CALL = d.CALL
       AND c.letting = d.letting
       AND v.vendor = d.vendor
       AND l.letstat = 'A'
       AND b.datelet BETWEEN TO_DATE ( '2007/01/01', 'yyyy/mm/dd') AND TO_DATE ( '2011/12/31', 'yyyy/mm/dd')
    GROUP BY v.vendor,
             v.vnames,
             d.calcbtot,
             (d.calcbtot / l.contamt),
             B.DATELET,
             d.CALL
    ORDER BY b.datelet, "Bidders Estimate") where rn=1
    

    G.

Maybe you are looking for

  • Can I upgrade my GPU / CPU?

    Hi, I was interested by the upgrade of my GPU or CPU and I just want to know if it is possible, before I open my laptop. The chips are soldered to the motherboard? Or would it be a simple and in the upgrade. Thank you. PS: If someone could also menti

  • Why can I not have all my iTunes on my new phone (6 s)?

    Help! Why not transfer all of my music from my iPhone to my new 6 s 5s? 77 albums and more than 600 songs on my 5, 35 albums on my new s 6? The strange thing is a few albums and songs that were not purchased via iTunes have shown up on my new phone a

  • M251n: Printer locked

    Hello By mistake I changed the settings to my HP M251n network and the menu is locked to the printer. He is now having a 169.254.x.x IP system, how do I reset the default printer?

  • Microsoft Update 8E5E0147 error code

    I was unable to install updates from Microsoft for some time; I get error code 8E5E0147.  Please help - thanks!

  • I don't have a genuine version of Windows.

    He is now 21/05/2015 pop up says I have a fake Windows and I am unable to run iTunes or some other music downloads. Windows diagnostic tool tells me that my version is 100% authentic as the sticker on the side. I've been here when it was checked for