Tables not having joins

hi
i have the following two queries with me
SELECT   SUM (  (  (NVL (j.opn_value, 0) * NVL (j.item_price, 0))
                 - (  NVL (j.opn_value, 0)
                    * NVL (j.item_price, 0)
                    * (NVL (j.dis_per, 0) / 100)
              - (  (NVL (e.ser_dis_per, 0) / 100)
                 * NVL ((  (NVL (j.opn_value, 0) * NVL (j.item_price, 0))
                         - (  NVL (j.opn_value, 0)
                            * NVL (j.item_price, 0)
                            * (NVL (j.dis_per, 0) / 100)
                        0
              - NVL (e.ser_dis_value, 0)
             ) netvalue
    FROM xxnp_opn_joblog_001 e, xxnp_opn_joblog_res_005 j
   WHERE e.opn_job_desc = 'K/D/HH35/BG739/958/D/0211/1'
     AND e.MANUAL = 'N'
     AND e.opn_joblog_001_id = j.opn_joblog_001_id
GROUP BY e.opn_job_desc
/* Formatted on 2011/09/22 11:51 (Formatter Plus v4.8.0) */
SELECT SUM (h.slurry_vol_actual) totalsum
  FROM xxnp_opn_joblog_slurry_003 h, xxnp_opn_joblog_001 j
WHERE h.job_number = 'K/D/HH35/BG739/958/D/0211/1'
   AND h.opn_joblog_001_id = j.opn_joblog_001_idi require Netvalue/totalsum
but i am not able to as the tables xxnp_opn_joblog_slurry_003 h and xxnp_opn_joblog_res_005 j have no common columns
kindly guide as to how to obtain this
thanking you

The result will most certanily be different since the ID's for opn_joblog_001_id that exist in the "h" table when joined to "e" and "j" will either increase or decrease the result.
What happens when you join on the ID as follows?
select sum
                 (nvl (j.opn_value, 0) * nvl (j.item_price, 0))
               - (nvl (j.opn_value, 0) * nvl (j.item_price, 0) * (nvl (j.dis_per, 0) / 100))
                 (nvl (e.ser_dis_per, 0) / 100) * nvl (
                                                        (  (nvl (j.opn_value, 0) * nvl (j.item_price, 0))
                                                         - (nvl (j.opn_value, 0) * nvl (j.item_price, 0) * (nvl (j.dis_per, 0) / 100))
                                                       ,0
              -  nvl (e.ser_dis_value, 0)
        sum(h.slurry_vol_actual) as Net_Over_Total_Value
from 
         xxnp_opn_joblog_001        e
        ,xxnp_opn_joblog_res_005    j
        ,xxnp_opn_joblog_slurry_003 h
where
         e.opn_job_desc          = 'K/D/HH35/BG739/958/D/0211/1'
and      e.MANUAL                = 'N'
and      e.opn_joblog_001_id     = j.opn_joblog_001_id
and      j.opn_joblog_001_id     = h.opn_joblog_001_id
and      e.opn_job_desc          = h.job_number
group by
         e.opn_job_desc

Similar Messages

  • Joining Tables not having any Common Fields

    Dear Gurus,
    I know how to join the tables having common fields through T-CODE: SQVI,  but do not know how to join the tables not having any common fields.
    kindly provide me the step by step procedure to handle this, so that I can generate the Reports.
    Wishes,
    Abhishek

    Check following link. I feel it might of some assistance for you:
    SAP Query - illegal Join condition
    Regards
    J Prakash

  • Configure CDC on tables not having Primary Key

    Hi,
    On one of our client majority of tables in their huge database are not having primary key. While starting journaling ODI-15021 error is being thrown. Is there any way to configure CDC on those tables. Even we are not in a situation to create logical primary key on ODI level. Client is asking for an oracle document which talks about such restriction. Kindly help me out. I've gone through documentation as well metalink. I'm not able to find any information regarding it.
    Regards,
    Shashi Ranjan

    Hi,
    Thanks a lot for your prompt reply. Let me describe my situation bit more clearer. I've configured ODI CDC on one schema which contains 1200 tables. I tried to configure primary key on each data store in source model but being an integrator, I'm not the right person to decide primary key on tables so, I reverted back to client to create primary key on tables or suggest what should be primary key. Now, client is asking for an oracle document stating that primary key is mandatory. They have such 20 schema with similar huge number of tables. I've gone through various documents and meta-links but no luck. Need urgent help on it.
    Regards,
    Shashi Ranjan

  • Tables not having PK.

    Guys,
    I'm looking for a SQL query to get the list of all tables that doesn't have Primary Key.
    Btw, I'm not able to select from "information_schema" dictionary view. Could someone help me with an alternate qery please?
    -Bugs

    Hi, Bugs,
    Bugs wrote:
    Guys,
    I'm looking for a SQL query to get the list of all tables that doesn't have Primary Key.Here's one way:
    ELECT     owner, table_name
    FROM     all_tables
        MINUS
    SELECT     owner, table_name
    FROM     all_constraints
    WHERE     constraint_type     = 'P'
    ;The first half of this (the part before the MINUS) is all the tables you have privileges on.
    The second half (after the MINUS) is all the tables with a primary key.
    If you have privileges on dba_tables and dba_constraints, you can use them instead of all_tables and all_constraints.
    Btw, I'm not able to select from "information_schema" dictionary view. Could someone help me with an alternate qery please?What is information_schema?

  • DBAdapter Creating Relations between tables not having PF-FK relationship

    I am writing a process which has to pull data from three tables.
    SELLER_HEADER (inv_Num is Primary Key)
    SELLER_LINE_ITEMS ( no PK but has inv_num and line_number which together are unique)
    BUYER_LINE_ITEMS (no PK but has cust_num, cust_PO_num and line_num that are unique)
    I want to create a DB Adapter which would take in an invoice number, customerNumber and customerPONumber
    and fetch me data whose XSD is roughly in this structure
    One Node of Type Header
    ---- Column 1 of the Header Table
    ---- Column 2 of the Header Table
    ---- Column 3 of the Header Table
    ... and so on
    Multiple Nodes of
    ---- Column 1 of the Seller Table
    ---- Column 2 of the Seller Table
    ---- Column 3 of the Seller Table
    and
    ---- Column 1 of the Buyer Table
    ---- Column 2 of the Buyer Table
    ---- Column 3 of the Buyer Table
    I tried some combinations and found that if you have a 1:M mapping for Header - Seller Line Item
    and a 1:1 mapping between Seller Line Item and Buyer Line Item then i get the desired XSD
    So, I created a 1:M relation between header and Seller lineItems. However i cannot create a one to one mapping between Seller Line Items and Buyer line items. Nor can i create a 1 :M mapping between Seller Header and Buyer Line Items. That is why the generated XSD shows
    <SomeCollectionName>
    <SellerHeader>
    <BuyerLineItems>
    <SellerLineItems>
    </SomeCollectionName>
    Any pointers for this? How do i make a relation based on the input values to the DBAdapter

    Does the CORE_BUSINESS schema have REFERENCES and SELECT privileges on the table you are trying to reference with the foreign key constraint?

  • 2 fact Tables not joining to all the same dimensions

    Hi there,
    I have 2 Fact tables
    1) Errors (count)
    2) Tasks (count)
    both share the following dimension - customer
    and both have a dimension that joins only to itself
    1) Errors type (joining to errors Fact)
    2) Tasks type (joining to Tasks Fact)
    In Answers I can see customer and errors count and task count together
    When I add Errors Type, the Tasks count returns 0 (it doesn't disappear)
    When I add Tasks Type, the Errors count returns 0 (it doesn't disappears)
    customer - errors count - tasks count
    xyz 2 8
    customer - errors count - tasks count - task type
    xyz 0 8 abc
    customer - errors count - tasks count - errors type
    xyz 2 0 123
    I have seen some documentation on fact tables not joining all dimensions but any help would be appreciated
    Thanks

    The end game would be to be able to see the following:
    customer - errors type - errors count - task count - tasks type
    xyz 123 2 8 abc
    Initially I would take the either or:
    customer - errors type - errors count - task count -
    xyz 123 2 8
    customer - errors count - task count - tasks type
    xyz 2 8 abc
    I think there is something I ned to do in the Repositry?

  • Why not to Join Fatc to fact tables in OBIEE... What is the Logical Reason

    Why not to Join Fatc to fact tables in OBIEE... What is the Logical Reason
    Thanks in advance
    V

    Hi Venkat,
    I am coming from the basics of a star schema here, so hope it helps
    What is a fact?
    A fact is something that has all measures which can be aggregated (Units, Dollars, # of Orders) etc with keys to different dimensions.
    What is a dimension?
    It is the context with which we understand/record/retrieve the measures in the fact. We understand "# of Orders" for a product/By a customer etc.
    So joining a dimension and a fact helps to answer the Who/What/When kind of business questions. Ex : Who bought these products? What was the product type? When these products were sold kind of...
    Now just imagine tying up fact to another fact. With this kind of model, you can never answer any business question.
    I have never tried joining a fact with another fact in OBI (But do not think it will allow it though :) )
    Hope I am clear.
    Thank you,
    Dhar

  • How to create entity for the table which is not having the primary key

    Hi,
    Is it possible to create an entity for the table which is not having the primary key.
    I have to write a method in my session bean and that method must use this entity.
    any websites for this.

    If you are talking about processes launched from a JVM (running outside), Process is available.
    If you are talking about processes already running outside of a JVM, you could roll-your-own class to provide similar functionality as Process. This approach would be platform dependent, backed by the platform's I/O scripting and therefore limited to what the platform supports for process manipulation, e.g. Linux/Unix capabilities far exceed Windows.

  • List of customers who are not having sales orders

    Hi All,
    Hi All,
    I want to take list of customer numbers which are not having any sales activities(No sales transactions) from required date. Do we have any standard functionalty to find all these kind of customers.
    I can get all customer numbers (Sold to party) from KNA1 table, then if we do somuch manual work, then we will be able to find those customers. In that manual work we may do some mistakes, that will not give 100% perfect result. So, we are searching for any standard functionality.
    Please let us your views.
    Regards
    Lakshmikanth

    This depends on how "sales" are defined in your organization.
    If we are talking about the sales documents (orders, contracts and such - VBAK table), then there is no standard report. The Sold-to customers that do not have any sales documents may be identified by creating a query (SQVI, for example) on table KNA1 with LEFT JOIN on VBAK table by KNA1-KUNNR and VBAK-KUNNR field. (VAKPA table may be used instead of VBAK for better performance, as long as it's being populated in your system.) The KNA1 records that will come out without any VBAK records will be the customers with no sale documents.
    If the invoiced (i.e. billed) sales have to be considered, then most likely S_ALR_87012186 suggested above or the same query but with VBRK will work.
    Please note that S_ALR_87012186 report uses KNC1 table, which is not updated when a sales document has just been created. I've just tested this report with a new customer with one contract and it came out as having "no sales" and there were no entries in KNC1. I bet this table is updated only when something is posted into Accounting. If this fits your requirements, then, naturaly, this report would be the way to go.

  • Inner join with data also from non having join column

    I have an Dim table which has to be joined with Fact Table using inner join, but also display the Dimension value " MasterGroup " inspite of data present or not in the fact table.
    My Query:  .. This is an part of my stored procedure with more tables
    SELECT a.SalesAmount, b.HeaderGroup ,c.CityName
    FROM dbo.FactItem a
    inner join dbo.[DimHeader] b
    on a.sid = b.sid
    left join dbo.DimCity c
    on a.cityid = c.id
    My DimHeader Table will have data like
    MasterGroup
    ChildGroup
    etc...
    which is an attribute.
    There might not be any relevent fact data, but still i want the dimension data to display the "MasterGroup"
    ShanmugaRaj

    hello ,
    usually this is not possible when the column you want to display when the matches not found from a table having a distinct values which are hard to declared static..
    you can incorporate something like this if you cant change the join type ..
    select distinct HeaderGroup from dbo.[DimHeader] tbl_outerleft join (SELECT a.sid,a.SalesAmount, b.HeaderGroup ,c.CityName
    FROM dbo.FactItem a
    inner join dbo.[DimHeader] b
    on a.sid = b.sid
    left join dbo.DimCity c
    on a.cityid = c.id) tbl_Main on tbl_Main.sid =tbl_outer.sid
    Dilip Patil..

  • Need help to join two tables using three joins, one of which is a (between) date range.

    I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
    the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
    ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
    [ABCTABLE]
    ABCORDER
    ABCPART
    ABCSERIAL
    ABCDATE
    [ZYXTABLE]
    XYZORDER
    XYZPART
    XYZSERIAL
    XYZDATE1
    XYZDATE2

    Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
    on this computer. There are no "Null" fields in either of the tables. 
    This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
    [MSORDR]
    MSORDER
    MSPART
    MSSERIAL
    MSOPNDATE
    11111111
    4444444
    55555
    2/4/2015
    22222222
    6666666
    11111
    1/6/2015
    33333333
    6666666
    11111
    3/5/2015
    This table has one order for every part number and every serial number.
    [GLORDR]
    GLORDER
    GLPART
    GLSERIAL
    GLSTARTDATE
    GLENDDATE
    ABC11111
    444444
    55555
    1/2/2015
    4/4/2015
    ABC22222
    666666
    11111
    1/5/2015
    4/10/2015
    AAA11111
    555555
    22222
    3/2/2015
    4/10/2015
    Post Query table
    GLORDER
    MSORDER
    GLSTARTDATE
    GLENDDATE
    MSOPNDATE
    ABC11111
    11111111
    1/2/2015
    4/4/2015
    2/4/2015
    ABC22222
    22222222
    1/5/2015
    4/10/2015
    1/6/2015
    ABC22222
    33333333
    1/5/2015
    4/10/2015
    3/5/2015
    This is the SQL minus the between date join.
    SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
    FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART);

  • ORA-01776: cannot modify more than one base table through a join view

    I have created EO based on a database view than consists of two tables, and only one is updateable.
    When I try to update a row using EO, I got a following message: "ORA-01776-cannot modify more than one base table through a join view"
    In Forms, this issue is resolved by setting "Query Only" property of non-updateable items to "True".
    Is it possible to do something like that in ADF BC?
    Thanks

    Thanks for answer.
    When I set "updateable" property to "Never", that attribute is protected from any change.
    I'm sorry for incomplete usecase.
    I have set up a list of value on that attribute, because it is a lookup field for another table and I need to get an ID from that table.
    Basically, I need that attribute to be updateble for BC, but not for database.
    Edited by: MarioK on Oct 13, 2011 9:28 AM

  • Cannot modify more than one base table through a join view

    hi guys, my current problem is that i have a datablock based on a view, now all the fields bar 1 are updateable, but this one field that is obtained through a join is displayed, the user can enter data in this field which then pupulates other fields which are required, but this specific field should not be updated. Is there an option to state this as i keep getting the error:
    cannot modify more than one base table through a join view
    Any help would be greatly appreciated, thanks.

    the user can enter data in this field which then pupulates other fields So, using the value of "this field" you then query the rest of the fields? Can you show us the code you use to populate the rest of the fields?
    but this specific field should not be updatedHave you tried setting the "Query Only" property of the field to "Yes" and the other DML properties (Ins, Upd, Del) to No?
    Also, what is your Forms version?
    Thanks,
    Craig B-)
    If someone's response is helpful or correct, please mark it accordingly.

  • Extended Classic Scenario - SHC: Buffer table not up to date

    Hello all,
    I'm working in SRM_SERVER 550, SAPKIBKT11, and having issues using BACKEND PURCHASING ORGANISATIONS and the Extended Classic Scenario.
    According to SAP note 944918 the following indicator should not be required to be set:
    Supplier Relationship Management>SRM Server>Cross-Application Basic Settings>Activate Extended Classic Scenario --> extended classic scenario active.
    I did set the Backend Purch. Grps Responsible indicator, and I did create organizational units specifically for the backend purch. grps.
    We need to set the main part of all SHCs to ECS, but when I do set the indicator in customizing to "extended classic scenario = active", I get a dump in my web environment: 'buffer table not up to date'.
    What is causing this failure in my SHC?
    I tried to implement BAdI "BBP_EXTLOCALPO_BADI" (method DETERMINE_EXTPO) like described below here: without the line bbp_extpo_gl-bbpexpo = 'X'., I can continue and create the SHCs. Problem is though: all SHCs will get marked as Classic Scenario. So, to make sure the SHCs will always get marked as ECS, I have added this line in the BAdI. Unfortunately this immediately results in the 'buffer table not up to date' error in the SHC itself, as soon as I try to open the details of the new item.
    Hope you help me out here?? It doesn't seem to be related to the BAdI, but somehow the system doesn't allow me to mark SHC items as ECS.
    Thanks & Regards,
    Berend Oosterhoff
    SRM Consultant Accenture Technology Solutions - The Netherlands.
    BAdI BBP_EXTLOCALPO_BADI:
    method IF_EX_BBP_EXTLOCALPO_BADI~DETERMINE_EXTPO.
    data definition----------------------------------------------------*
      DATA:    wa_mattype     TYPE BAPIMATDOA,
               wa_char18      TYPE MATNR,
               attrib_tab     TYPE TABLE OF bbp_attributes,
               wa_attrib_tab  TYPE bbp_attributes,
               wa_value       TYPE om_attrval,
               wa_product_id  TYPE comt_product_id.
        bbp_extpo_gl-bbpexpo = 'X'.
    from here I did the specific selection for the SC, but that's not relevant here.

    Hi Prashant,
    Thanks for your quick reply!
    Note 1085700 is about Short Dumps when creating or changing a contract. I am trying to create a Shopping Cart, without a reference to a contract. BAdI BBP_DOC_CHANGE_BADI is not active in our system.
    Any other thoughts?
    Regards,
    Berend

  • Dimension Table that doesnot join to any fact source

    Hi,
    I'm getting an error while Consistnecy Check that 'Dimension Table that doesnot join to any fact source' but in my physical layer i did not join to any fact table. where as i've a fact in BMM layer . Cany any one help me on it.
    Thanks,
    Malli

    Hi,
    Please make sure u r dimension and fact join some of one dimension joins are not mapped with fact table. check the dimensions with any fact table. If you don't have any fact, create some dummy fact table and connect with complex join.
    OBI expects atleast two tables in the logical level, 1 for dimension & another for fact.
    THanks
    Deva

Maybe you are looking for