Steps to create a View..

Dear Gurus,
plz help me how to create a help & maintanace view.
Plz tell me the steps....

hi,
Help View.
http://help.sap.com/saphelp_nw70/helpdata/en/cf/21ed13446011d189700000e8322d00/content.htm
Maintenance View
http://help.sap.com/saphelp_40b/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
Creating Help Views
Procedure
Enter an explanatory short text in the field Short text.
You can for example find the view at a later time using this short text.
Enter the primary table of the view under Tables in the Tables/Join conditions tab page.
Only tables that are linked with the primary table (indirectly) with a foreign key can be included in the view.
Save your entries.
You are asked to assign the help view a development class. You can change this development class later with Extras ® Object directory entry.
If required, include more tables in the view. In a help view you can only include tables that are linked to one another with foreign keys.
Position the cursor on the primary table and choose Relationships. All existing foreign key relationships of the primary table are displayed. Select the foreign keys and choose Copy. The secondary table involved in such a foreign key is included in the view. The join conditions derived from the foreign keys (see Foreign Key Relationship and Join Condition) are displayed.
You can also include tables that are linked with a foreign key to one of the secondary tables already included. To do this, place the cursor on the secondary table and choose Relationships. Then proceed as described above.
For maintenance and help views, there are certain restrictions on the foreign keys with which the tables can be included in the view (see Restrictions for Maintenance and Help Views). The foreign keys violating these conditions are displayed at the end of the list under the header Relationships with unsuitable cardinality.
On the View fields tab page, select the fields that you want to copy to the view. The key fields of the primary table were automatically copied to the view as proposals.
Choose Table fields. All the tables contained in the view are listed in a dialog box. Select a table. The fields of the table are now displayed in a dialog box. Select the required fields in the first column and choose Copy.
On the Selection conditions tab page, you can (optionally) formulate restrictions for the data records to be displayed with the view (see Maintaining Selection Conditions for Views).
The selection conditions define the data records that can be selected with the view.
Siva

Similar Messages

  • Error while creating a View Cluster

    Hello Gurus,
         I have created two maintenance views ZVIEW1 & ZVIEW2  with table maintenance generator.Know I am trying
         to create a view cluster using these views.
         I have Proceeded with the following steps to create the View Cluster:
         1. Tcode : SE54 --> GIven the name ZVIEWCLUSTER as View Cluster name & pressed ENTER.
         2. Filled the description of the View cluster.
         3.Selected the tab OBJECT STRUCTURE  and filled it with ZVIEW1 & ZVIEW2.
         4.Selected view ZVIEW1 and clicked on button "FIELD-DEPENDENCE" ,System throws a message
             "Field-dependence generated succesfully"
         5. Selected view ZVIEW2 and clicked on button "FIELD-DEPENDENCE" ,System throws an error message
             "No log generated".
          Am stuck up at point 5 in the above mentioned steps.
          Please guide me in coming out of this error message.
    Regards,
    Najam

    Hi Najam,
    I don't think you need to define field dependencies for both tables, you only define the relationship from the second table to the first.
    Double-click on the Field dependencies folder and check the link between the two tables is correctly defined, if so you don't need to generate the field dependency twice.
    Regards,
    Nick

  • How to create a view?

    HI friends,
                  Can any one help me out in creation of view i am suceeded in creation but while display it is showing no records
    i think i am going wrong in selection conditions....can anyone give me clear steps to create a  view.?

    Hi,
    The followings are different types of views:
    - Database View (SE11)
    Database views are implement an inner join, that is, only records of the primary table (selected via the join operation) for which the corresponding records of the secondary tables also exist are fetched. Inconsistencies between primary and secondary table could, therefore, lead to a reduced selection set.
    In database views, the join conditions can be formulated using equality relationships between any base fields. In the other types of view, they must be taken from existing foreign keys. That is, tables can only be collected in a maintenance or help view if they are linked to one another via foreign keys.
    - Help View ( SE54)
    Help views are used to output additional information when the online help system is called.
    When the F4 button is pressed for a screen field, a check is first made on whether a matchcode is defined for this field. If this is not the case, the help view is displayed in which the check table of the field is the primary table. Thus, for each table no more than one help view can be created, that is, a table can only be primary table in at most one help view.
    Go thru this link plzz
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ecf9446011d189700000e8322d00/frameset.htm
    Difference between "Help View" and "Search Help"
    - Projection View
    Projection views are used to suppress or mask certain fields in a table (projection), thus minimizing the number of interfaces. This means that only the data that is actually required is exchanged when the database is accessed.
    A projection view can draw upon only one table. Selection conditions cannot be specified for projection views.
    - Maintenance View ( SE54 )
    Maintenance views enable a business-oriented approach to looking at data, while at the same time, making it possible to maintain the data involved. Data from several tables can be summarized in a maintenance view and maintained collectively via this view. That is, the data is entered via the view and then distributed to the underlying tables by the system.
    Please have a look at below link. It will help you.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed06446011d189700000e8322d00/frameset.htm
    for more detailed info look on:
    http://www.sap-img.com/abap/what-is-the-different-types-and-usage-of-views.htm
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/abap+dictionary&
    1.Go to se11
    2. select view radiobutton and give a name
    3. Create
    4. select type of view you want to create. Such as database view.
    5. give short description
    6. give a table name such as mara
    7. press the pushbutton relationship. here you will find all the tables which are allowed to create view with mara.
    8. select one or mane tables.
    8 copy
    9.save , check and activate.
    cheers,
    vasavi
    kindly reward if helpful

  • Create a View with two BEx Queries in BEx

    Hi Experts,
    I have got a scenario where in I have to create a single view on two BEx queries. Can any one give me the necessary steps to create the View?
    Awaiting for your reply,
    Thanks in advance,
    With kind regards,
    Shreeem

    Hi Shreem,
      I think that can be easily done. Check the below thread
    WAD - Integration of multiple queries
    Also see If you can include the two queries in a workbook and maybe later you can try creating a view on it?
    Thanks

  • How to create materlised view in oracle 10g what are the step to create it

    hi,
    this hafeez i have a database in oracle 10g now i want to create materlised view to the database what arre the step required for it.

    You should refer to documentation for more information:
    [Overview of Materialized Views|http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/schema.htm#CNCPT411]
    Kamran Agayev A. (10g OCP)
    http://kamranagayev.wordpress.com
    [Step by Step install Oracle on Linux and Automate the installation using Shell Script |http://kamranagayev.wordpress.com/2009/05/01/step-by-step-installing-oracle-database-10g-release-2-on-linux-centos-and-automate-the-installation-using-linux-shell-script/]

  • Error while creating Materialized View step 3 of 6 using wizard

    have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating Materialized View step 3 of 6

    I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Create Relational View got error: ORA-19276: XPST0005 - XPath step specifie

    Hi expert,
    I am using Oracle 11.2.0.1.0 XML DB.
    I am successfully registered schema and generated a table DOCUMENT.
    I have succfully inserted 12 .xml files to this table.
    SQL> SELECT OBJECT_VALUE FROM document;
    OBJECT_VALUE
    <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="http://www.accessdata.fda.gov/spl/stylesheet/spl.xsl" type="text/xsl"?>
    <document xmlns="urn:hl7-org:v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 http://localhost:8080/home/DEV/xsd/spl.xsd">
    <id root="03d6a2cd-fdda-4fe1-865d-da0db9212f34"/>
    <code code="51725-0" codeSystem="2.16.840.1.113883.6.1" displayName="ESTABLISHMENT REGISTRATION"/>
    </component>
    </document>
    then I tried to create a create Relational View base on one inserted .xml file I got error:
    ERROR at line 3:
    ORA-19276: XPST0005 - XPath step specifies an invalid element/attribute name: (document)
    is there anyone know what was wrong?
    Thanks a lot!
    Cow
    Edited by: Cow on Feb 15, 2011 8:58 PM
    Edited by: Cow on Feb 21, 2011 6:59 AM

    These kinds of issues, you will have to solve by joining multiple resultsets or passing fragments to the next XMLTABLE statement and building redundancy via the ORDINALITY clause (which results a NUMBER datatype)
    For example
    A "transaction" can have multiple "status"ses which can have multiple "reason"s
    WITH XTABLE
    AS
      (SELECT xmltype('<TRANSACTION>
                        <PFL_ID>123456789</PFL_ID>
                        <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
                        <ID>1</ID>
                        <INSTR_ID>MARCO_003</INSTR_ID>
                        <E_TO_E_ID>MARCO_004</E_TO_E_ID>
                        <INSTD_AMT>10</INSTD_AMT>
                        <INSTD_AMT_CCY>EUR</INSTD_AMT_CCY>
                        <STATUS>
                            <PFL_ID>123456789</PFL_ID>
                            <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
                            <TXI_ID>1</TXI_ID>
                            <ID>1</ID>
                            <PMT_TX_STS_UTC_DT>2011-02-15</PMT_TX_STS_UTC_DT>
                               <REASON>
                                  <ID>1000</ID>
                                  <STS_RSN_PRTRY>MG001</STS_RSN_PRTRY>
                               </REASON>
                               <REASON>
                                  <ID>2000</ID>
                                  <STS_RSN_PRTRY>IS000</STS_RSN_PRTRY>
                               </REASON>
                         </STATUS>
                      </TRANSACTION>') as XMLCOLUMN
      FROM DUAL
    SELECT STS_ID             as STATUS_ID,
           STS_PFL_ID,
           STS_PMI_ID,
           STS_TXI_ID,
           RSN_ID             as REASON_ID,
           RSN_STS_RSN_PRTRY,
           RSN_XML_POS        as POSITION
    FROM  XTABLE
    ,     XMLTABLE ('/TRANSACTION/STATUS'
                    PASSING XMLCOLUMN
                    COLUMNS
                        STS_PFL_ID         NUMBER(10)    path 'PFL_ID'
                      , STS_PMI_ID         NUMBER(10)    path 'PMI_ID'
                      , STS_TXI_ID         NUMBER(10)    path 'TXI_ID'
                      , STS_ID             VARCHAR2(10)  path 'ID'
                      , XML_REASONS        XMLTYPE       path 'REASON'
                      ) sts
    ,     XMLTABLE ('/REASON'
                    PASSING sts.XML_REASONS
                    COLUMNS
                        RSN_XML_POS        FOR ORDINALITY
                      , RSN_ID             VARCHAR2(10)  path 'ID'
                      , RSN_STS_RSN_PRTRY  VARCHAR2(10)  path 'STS_RSN_PRTRY'
                      ) rsnWill give you the following output (in your case DON"T forget to buildin the namespace references)
    SQL> WITH XTABLE
      2  AS
      3   (SELECT xmltype('<TRANSACTION>
      4             <PFL_ID>123456789</PFL_ID>
      5             <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
      6             <ID>1</ID>
      7             <INSTR_ID>MARCO_003</INSTR_ID>
      8             <E_TO_E_ID>MARCO_004</E_TO_E_ID>
      9             <INSTD_AMT>10</INSTD_AMT>
    10             <INSTD_AMT_CCY>EUR</INSTD_AMT_CCY>
    11            <STATUS>
    12              <PFL_ID>123456789</PFL_ID>
    13              <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
    14              <TXI_ID>1</TXI_ID>
    15              <ID>1</ID>
    16              <PMT_TX_STS_UTC_DT>2011-02-15</PMT_TX_STS_UTC_DT>
    17                <REASON>
    18                  <ID>1000</ID>
    19                  <STS_RSN_PRTRY>MG001</STS_RSN_PRTRY>
    20                </REASON>
    21                <REASON>
    22                   <ID>2000</ID>
    23                   <STS_RSN_PRTRY>IS000</STS_RSN_PRTRY>
    24                </REASON>
    25              </STATUS>
    26           </TRANSACTION>') as XMLCOLUMN
    27   FROM DUAL
    28   )
    29  SELECT STS_ID             as STATUS_ID,
    30         STS_PFL_ID,
    31         STS_PMI_ID,
    32         STS_TXI_ID,
    33         RSN_ID             as REASON_ID,
    34         RSN_STS_RSN_PRTRY,
    35         RSN_XML_POS        as POSITION
    36  FROM  XTABLE
    37  ,     XMLTABLE ('/TRANSACTION/STATUS'
    38                  PASSING XMLCOLUMN
    39              COLUMNS
    40                  STS_PFL_ID         NUMBER(10)    path 'PFL_ID'
    41                , STS_PMI_ID         NUMBER(10)    path 'PMI_ID'
    42                , STS_TXI_ID         NUMBER(10)    path 'TXI_ID'
    43                , STS_ID             VARCHAR2(10)  path 'ID'
    44                , XML_REASONS        XMLTYPE       path 'REASON'
    45            ) sts
    46  ,     XMLTABLE ('/REASON'
    47                  PASSING sts.XML_REASONS
    48              COLUMNS
    49                  RSN_XML_POS        FOR ORDINALITY
    50                , RSN_ID             VARCHAR2(10)  path 'ID'
    51                , RSN_STS_RSN_PRTRY  VARCHAR2(10)  path 'STS_RSN_PRTRY'
    52            ) rsn
    53 ;
    STATUS_ID  STS_PFL_ID STS_PMI_ID STS_TXI_ID REASON_ID  RSN_STS_RS   POSITION
    1           123456789          1          1 1000       MG001               1
    1           123456789          1          1 2000       IS000               2
    2 rows selected.If I wouldn't have done that then I would have got your result which fails with your error:
    - ORA-19279 - XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence
    SQL> WITH XTABLE
      2  AS
      3   (SELECT xmltype('<TRANSACTION>
      4             <PFL_ID>123456789</PFL_ID>
      5             <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
      6             <ID>1</ID>
      7             <INSTR_ID>MARCO_003</INSTR_ID>
      8             <E_TO_E_ID>MARCO_004</E_TO_E_ID>
      9             <INSTD_AMT>10</INSTD_AMT>
    10             <INSTD_AMT_CCY>EUR</INSTD_AMT_CCY>
    11            <STATUS>
    12              <PFL_ID>123456789</PFL_ID>
    13              <PMI_ID>1</PMI_ID><PII_ID>1</PII_ID>
    14              <TXI_ID>1</TXI_ID>
    15              <ID>1</ID>
    16              <PMT_TX_STS_UTC_DT>2011-02-15</PMT_TX_STS_UTC_DT>
    17                <REASON>
    18                  <ID>1000</ID>
    19                  <STS_RSN_PRTRY>MG001</STS_RSN_PRTRY>
    20                </REASON>
    21                <REASON>
    22                   <ID>2000</ID>
    23                   <STS_RSN_PRTRY>IS000</STS_RSN_PRTRY>
    24                </REASON>
    25              </STATUS>
    26           </TRANSACTION>') as XMLCOLUMN
    27   FROM DUAL
    28   )
    29  SELECT STS_ID             as STATUS_ID,
    30         STS_PFL_ID,
    31         STS_PMI_ID,
    32         STS_TXI_ID,
    33         RSN_ID             as REASON_ID,
    34         RSN_STS_RSN_PRTRY
    35  FROM  XTABLE
    36  ,     XMLTABLE ('/TRANSACTION/STATUS'
    37                  PASSING XMLCOLUMN
    38              COLUMNS
    39                  STS_PFL_ID         NUMBER(10)    path 'PFL_ID'
    40                , STS_PMI_ID         NUMBER(10)    path 'PMI_ID'
    41                , STS_TXI_ID         NUMBER(10)    path 'TXI_ID'
    42                , STS_ID             VARCHAR2(10)  path 'ID'
    43                , RSN_ID             VARCHAR2(10)  path 'REASON/ID'
    44                , RSN_STS_RSN_PRTRY  VARCHAR2(10)  path 'REASON/STS_RSN_PRTRY'
    45           ) rsn;
                  </REASON>
    ERROR at line 24:
    ORA-19279: XQuery dynamic type mismatch: expected singleton sequence - got
    multi-item sequenceHTH
    Edited by: Marco Gralike on Feb 16, 2011 12:12 PM

  • [ADF Help] How to create a view for multiple tables

    Hi,
    I am using Jdeveloper 11G and ADF framework, and trying to create a view to update multiple tables.
    ex:
    Table A has these fields: ID, Name
    Table B has these fields: ID, Address
    A.ID and B.ID are primary keys.
    B.ID has FK relationship with A.ID
    (basically, these tables have one-to-one relation)
    I want to create a view object, which contains these fields: B.ID (or A.ID), A.Name, B.Address.
    So I can execute C,R,U,D for both tables.
    I create these tables in DB, and create entity objects for these tables.
    So there are 2 entity objects and 1 association.
    Then I create a view object based on B and add fields of A into the view:
    If the association is not a "Composition Association",
    when I run the model ("Oracle Business Component Browser") and try to insert new data, fields of A can't edit.
    If the association is a "Composition Association", and click the insert button, I will get
    "oracle.jbo.InvalidOwnerException: JBO-25030: Failed to find or invalidate owning entity"
    If I create a view object based on A and add filed of B into the view:
    When I run the model and try to insert new data, fields of B can't edit, no matter the association is or is not a composition association.
    So... how can I create a view for multiple tables correctly?
    Thanks for any advices!
    Here are some pictures about my problem, if there is any unclear point, please let me know.
    http://leonjava.blogspot.com/2009_10_01_archive.html
    (A is Prod, B is CpuSocket)
    Edited by: user8093176 on Oct 25, 2009 12:29 AM

    Hi Branislav,
    Thanks, but the result is same ....
    In the step 2 of creating view object, I can select entity objects to be added in to the view.
    If I select A first, and then select B (the "Source Usage" of B is A), then finishing the wizards.
    When I try to create a new record in the view, I can't edit any properties of B (those files are disabled).
    If I select B first, and then select A in crating view object, the result is similar ...
    Thanks for any further suggestion.
    Leon

  • Blog post : "Bug in Create/Edit View Criteria Wizard (JDeveloper 11g)"

    hi
    Using steps 1 to 13 from the blog post "Bug in Create/Edit View Criteria Wizard (JDeveloper 11g)" by Andrejus Baranovskis, I have been able to reproduce the issue he describes.
    see http://andrejusb.blogspot.com/2008/12/bug-in-createedit-view-criteria-wizard.html
    I the blog post comments he writes "... there was no time for me to fill bug in Metalink ...".
    Maybe someone from Oracle can pick it up from this forum post and file it as a bug if it is one (and if possible post the bug number here).
    many thanks
    Jan Vervecken

    The mechanism is to create a reproduceable test case, create a Service Request in metalink.oracle.com, post the test case, and convince the analyst to file it as a bug.
    It may be not efficient at some time, but this the way it is handled.
    --olaf                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to creat a view in

    Hi all,
    i am new to can u tell me how to creata a view. and how we can create node.and how we can create outbound plug and inbound plug.
    thanks & regards
    naveen

    Hi Naveen,
    In the component click on view qith the right button and select "Create View" follow the steps. Its a very simple wizard.
    Let me know if you have more issues.
    Best regards,
    Caíque Escaler

  • How to create a view in R/3?

    Hello, Can anyone plz gimme step by step how to create a view in R/3....

    Hi dear,
    go to SE11, out your Z* view and click create...
    Then choose your source tables, the join condition between them and, finally, all the fields (coming from source tables) you need for your purposes...
    http://help.sap.com/saphelp_erp2005vp/helpdata/en/cf/21ed06446011d189700000e8322d00/content.htm
    Hope it helps!
    Bye,
    ROberto

  • How to create a view in COMMPR01

    Hi Gurus,
    I have a few attributes that needs to be displayed in a seperate view in COMMPR01 (Similar to SAP BAsic Data, Sales & Distribution etc).
    How can I create this view?
    Any pointers would be of great help.
    Regards,
    Kris.

    Hi Kris,
    In order to define a view, go to the following path in IMG:
    - IMG->Cross application components->SAP Products->Settings for Product Maintenance->Define View, here you define your view.
    - Next step, while assigning the set types to category in transaction COMM_HIERARCHY, go to your category data, in the tabpage Settype, while adding your settype, give the Positon and View ID (Created in the previous step)
    This will create a view in your product.
    Hope this helps you
    regards
    Srikantan
    Edited by: Srikantan J on May 19, 2008 3:56 PM

  • HOW TO CREATE A VIEW WHICH CONTAINS A PARAMETER

    Hi all
    I am trying to create a view which contains paramaters.
    Lets assume that the view may look like this:
    STEP 1:
    CREATE OR REPLACE procedure Myproc(v_count in NUMBER) as
    BEGIN
    EXECUTE IMMEDIATE
    'CREATE OR REPLACE VIEW myview AS
    SELECT COUNT(*) FROM DUAL WHERE ROWNUM like '''||v_count||'%'' ';
    END myproc;
    SHOW ERRORS;
    Procedure created.
    Elapsed: 00:00:00.31
    SQL&gt; SHOW ERRORS;
    No errors.
    STEP 2:
    SQL&gt; EXEC Myproc(2);
    BEGIN Myproc(2); END;
    ERROR at line 1:
    ORA-00998: must name this expression with a column alias
    ORA-06512: at "MYUSERNAME.MYPROC", line 3
    ORA-06512: at line 1
    Elapsed: 00:00:00.16
    It seems that doesn't really likes the third line: "EXECUTE IMMEDIATE".
    Can I get any help with this one ?
    Thank-you
    Robert

    Bear in mind that VIEWs are not supposed to be parameterised. That is why Nature gave us a WHERE clause. However, there is one, albeit slightly clunky, way of doing it....
    SQL> CREATE OR REPLACE VIEW emp_view AS
      2  SELECT * FROM scott.emp
      3  WHERE deptno = sys_context('userenv','client_info')
      4  /
    View created.
    SQL>
    SQL>
    SQL> exec dbms_application_info.set_client_info(10)
    PL/SQL procedure successfully completed.
    SQL> SELECT * FROM emp_view
      2  /
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM
        DEPTNO
          7782 CLARK      MANAGER         7839 09-JUN-81       2450
            10
          7839 KING       PRESIDENT            17-NOV-81       5000
            10
          7934 MILLER     CLERK           7782 23-JAN-82       1300
            10
    SQL> Cheers, APC

  • Create Materialized View with GROUP BY

    I have a table
    treecluster NUMBER(3)
    treenumber NUMBER(3)
    treedate DATE
    nestnumber NUMBER(3)
    eggs NUMBER(3)
    nestlings NUMBER(3)
    fledglings NUMBER(3)
    nestfate VARCHAR2(10)
    nestfailurecode NUMBER(2)
    I want to group the data by treecluster, treenumber, year, and nest number and get a max eggs, nestlings, fledglings. I am doing this with the following:
    SELECT treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber,
    max(eggs), max(nestlings), max(fledglings)
    FROM nestchecks
    GROUP BY treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber;
    This works fine.
    The last record for a year has a nestfate and nestfailurecode value.
    I need to group all information and then also get the nestfate and nestfailurecode for the year. How do I go about getting this information?
    I am really trying to create a summary materialized view based on a data table so the select I am trying to craft would be a part of a create materialized view as SELECT...
    so I want to be able to group the info and add in the nestfate and failurecode in one step.
    Thanks!

    try this:
    SQL> select * from table_tree;
    TREECLUSTER TREENUMBER NESTCHECK NESTNUMBER       EGGS  NESTLINGS FLEDGLINGS NESTFATE   NESTFAILURECODE
              4        167 17-MAY-00          2          0          0
              4        167 24-MAY-00          2          3          0
              4        167 30-MAY-00          2          3          0
              4        167 12-JUN-00          2          0          1            FAILURE                  2
    select a.treecluster, a.treenumber, to_char(a.nestyear,'YYYY') nestyear,
           a.nestnumber, a.eggs, a.nestlings, a.fledglings, a.nestfate, a.nestfailurecode
    from   (select max(treecluster) treecluster, max(treenumber) treenumber,
                   max(nestchecksdate) nestyear,
                   max(nestnumber) nestnumber, max(eggs) eggs, max(nestlings) nestlings,
                   nvl(max(FLEDGLINGS),0) FLEDGLINGS, max(NESTFATE) NESTFATE,
                   max(nestfailurecode) nestfailurecode
            from table_tree) a
    TREECLUSTER TREENUMBER NEST NESTNUMBER       EGGS  NESTLINGS FLEDGLINGS NESTFATE   NESTFAILURECODE
              4        167 2000          2          3          1          0 FAILURE                  2hope this helps

Maybe you are looking for

  • Printing dashboard with network printer

    Is there any way to send/print the dashboard page to physical network printer? i am having links to HTML print and PDF print. But i want to print with network printer. please give some suggetion. thanks

  • How to use tv as a monitor with HDMI adapter

    with the HDMI adapter to thunderbolt plug the tv will display what is on my laptop monitor but only if I drag the screen to like 5 times its normal size. is there a way to just make it automaticly fit the tv everytime I want to use it as my monitor.

  • "Document Domain could not be saved."

    Evening folks, I'm working on a website and I'm trying to save and I'm getting an error that says "Document Domain could not be saved." A little background. In mid-may I wiped my drive and re-installed leopard. I reloaded iweb 09 and brought in the d

  • Problems with posting iDocs from MDM in SAP R3

    Hi, I am an MDM consultant, with limited knowledge about SAP R3. We send material master data from MDM, via PI to R3 using iDocs. We are having problems with posting MATMAS, and it seems the problems are with updating already existing materials. In B

  • How wake up the computer from sleep

    I have an HPE Pavilion h8-1100z, 64 bit, running Win 7. When the computers goes to sleep, I have problems waking it up. I have tried pressing various keys but nothing happens. Microsoft says to check the computer manual but I don't see anything in th