Building query ( Urgent )

I have to write a query in which I have to pick the records which have
same Source, Target, Content, key but different SENDER AND VALUE. If some SENDER
have addional record I have to display that also.
Table :- Message
Source Target content SENDER Key VALUE
S1 t1 c1 PMMS record_1 10 ( Match as key and value are same )
S1 t1 c1 PMMS record_2 3 ( Not Match )
S1 t1 c1 PMMS record_3 7 ( addional row )
S1 t1 c1 WMMS record_1 10 ( Match as key and value are same )
S1 t1 c1 WMMS record_2 5 ( Not Match )
S1 t1 c1 WMMS record_4 4 ( addional row )
O/P of the query.
Source Target content Sender Key value
S1 t1 c1 PMMS record_2 3
S1 t1 c1 PMMS record_2 5
S1 t1 c1 PMMS record_3 7
S1 t1 c1 WMMS record_4 4

select * from table
group by source, target, content,key, sender, value
order by source, target, content, key, sender

Similar Messages

  • To build query related to SNP: Planned Order

    Hi,
    System: SCM 5.0
    Scenario: SO received at plant and planning creates PR against SO at plant and accordingly SNP:Planned Order at Vendor location. If SO is cancelled/deleted (manually), sometime only the PR gets cancelled/deleted (automatically during planning run) but corresponding SNP:Planned Orders still remains at vendor location and so the dependent requirements. PR and Planned Orders are pegged to SO so one-to-one relation is maintained.
    I could not find any reason why system is not deleting Planned Order at vendor location despite SO and PR is deleted at plant location. So I am planning to build query where SNP:Planned Orders are not pegged to any PR or SO.
    Can anyone help with list of SNP:Planned Order tables so that I can build query around it to identify ghost Planned Orders.
    Hope I was clear with my query but let me know if any further information is require.
    Thanks and regards,
    Devang

    HI Marius,
    Sorry for delay reply.
    I was working on on some other more critical issues to business.
    Finally we decided to built report to identify obsolete Planned Orders for which PR is not available in ordering plant. I have listed below logic for that report:
    Get Location ID from table /SAPAPO/LOC based on Location entered in selection screen
    Get PEGIDs from FM /SAPAPO/DM_MATLOC_GET_PEGIDS based on IV_SIMID as 000 and location id from step 1
    In FM /SAPAPO/OM_PEG_CAT_GET_ORDERS, use SIMVERSION as 000 and in Import Para IS_GEN_PARAMS insert all PEGIDs from step 2.
    From Export Para ET_PEG_INPNODE take From_OrderID and store in internal table.
    Execute T.Code /SAPAPO/RRP4 with following selection (Use Selection Variant: OBSOLETE PR and add Location as entered in Selection Screen)
    Planning Version: 000
    From: Current date – 60 days
    To: Current date +180 days
    Location: 0000201328
    Product: *
    Order Type: 1F
        6. Compare output of step 4 and step 5 and display result.
    From FM /SAPAPO/DM_MATLOC_GET_PEGIDS the output (step 4) will be Order ID (22 characters) while step 5 (T.Code /SAPAPO/RRP4) will give Planned Order number (8 character). I am not sure how to compare Internal Order ID (22 characters) for corresponding Planned Order Nos. (8 characters).
    I have not marked your post as correct answer as still need to find answer of above query.
    Thank you in advance for your guidance.
    Regards,
    Devang Shah

  • Build Query in Transactions

    Hi All,
    Could you please let me know how queries or subqueries can be build using
    SQVI  or SQ01 or ZX02 transactions. For example :
    1)select * from zmstkcalc where werks_d <> werks_main.
    2)select * from zmstkcalc where werks_d in ( select werks from zmwerks_mu),
    Please note that i know how to sove this by writing program. But I would like build query instead of writing program.
    Thanks

    Hi
    Please find a pdf book on SQL Queries, this explains some steps on the same,
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVQUE/BCSRVQUE.pdf
    Regards
    Kathirvel

  • CommonSearchParseException: Error building query, common name {0} specified

    Hi,
    I have installed Content Server and I have setup CIS on Oracle OC4J standalone. I have also validated the configuration by the action "Validate communication with Oracle Content Server".
    I tried to execute the sample program CommonSearch from SDK.
    The program is taking a default query as "$author <substring> 'Adm'" and default metadata map from /resources/ucpmcommon-metamap-default.xml ]
    But I got the following error:
    CommonSearchParseException: Error building query, common name {0} specified but is not mapped.
    at com.stellent.cis.client.command.impl.services.CommandExecutorService.executeCommand(CommandExecutorService.java:62)
         at com.stellent.cis.client.command.impl.CommandFacade.executeCommand(CommandFacade.java:158)
         at com.stellent.cis.client.command.impl.BaseCommandAPI.invokeCommand(BaseCommandAPI.java:84)
         at com.stellent.cis.client.api.common.search.impl.CISSearchAPI.search(CISSearchAPI.java:59)
         at com.stellent.cis.sdk.samples.search.CommonSearch.execute(CommonSearch.java:78)
    I have configured the adapterconfig.xml matching the CIS adapter config in OC4J as given below:
    <?xml version="1.0" ?>
    <config>
         <adapter type="scs" default="true" name="myadapter">
              <config>
    <property name="port">4444</property>
    <property name="host">localhost</property>
    <property name="type">web</property>
    <property name="contentServerAdminID">sysadmin</property>
    <property name="contentServerAdminPassword">idc</property>
              </config>
              <beans template="classpath:/META-INF/resources/adapter/adapter-services-scs.jxml"/>
         </adapter>
    </config>
    My metada map is the default mapping as follows
    <metamap>
    <adapter name="scsadapter">
    <common>
    <map name="Title" native="dDocTitle" />
    <map name="Author" native="dDocAuthor" />
    <map name="Date" native="dInDate" />
    <map name="ID" native="dID" />
    </common>
    <contribution>
    <!-- native fields are used only for contribution -->
    <native name="comments" default="" override="true" />
    <!-- common fields refer back to common map, can also be tagged with default and override attributes -->
    <common name="title" />
    <common name="author" />
    </contribution>
    </adapter>
    </metamap>
    When is this error "common name {0} specified but is not mapped" thrown? Is my metadata map file correct?
    Thanks
    Raji

    Hi,
    I changed the query and executed the program, still getting the same error. I have followed the instructions in CIS developer guide to create the metamap file but unable to figure out the reason for the error. Any other suggestions?
    Thanks
    Raji

  • Error when building Query

      <p>Login OK!</p>  <p> </p>  <p>Select Universe OK!</p>  <p> </p>  <p>Build Query NOT OK!</p>  <p> </p>  <p>See the end of this message for details on invoking</p>  <p>just-in-time (JIT) debugging instead of this dialog box.</p>  <p> </p>  <p>************** Exception Text *************</p>  <p>System.InvalidOperationException: dsSpecification</p>  <p>   at BusinessObjects.Windows.Forms.WebIntelligence.ClassObjectPane.LoadUniverseClassObject(ImageList imageList, QueryBuilder query, Boolean bRef)</p>  <p>   at BusinessObjects.Windows.Forms.WebIntelligence.QueryPanelControl.LoadClassObject(QueryBuilder query)</p>  <p>   at QueryAsAWebServicesPublisher.Step4.Step4_ShowStep(Object sender, ShowStepEventArgs e)</p>  <p>   at TSWizards.BaseStep.OnShowStep(ShowStepEventArgs e)</p>  <p>   at TSWizards.BaseStep.FireShowEvent(ShowStepEventArgs e)</p>  <p>   at TSWizards.BaseWizard.AttachStep(StepDirection direction)</p>  <p>   at TSWizards.BaseWizard.SetCurrentStep(BaseStep step, StepDirection dir)</p>  <p>   at TSWizards.BaseWizard.SetCurrentStep(String name, StepDirection dir)</p>  <p>   at TSWizards.BaseWizard.MoveNext()</p>  <p>   at TSWizards.BaseStep.OnNext()</p>  <p>   at TSWizards.BaseStep.Wizard_OnNextClicked(Object o, EventArgs e)</p>  <p>   at TSWizards.BaseWizard.OnNextClicked(EventArgs e)</p>  <p>   at TSWizards.BaseWizard.next_Click(Object sender, EventArgs e)</p>  <p>   at System.Windows.Forms.Control.OnClick(EventArgs e)</p>  <p>   at System.Windows.Forms.Button.OnClick(EventArgs e)</p>  <p>   at System.Windows.Forms.Button.WndProc(Message& m)</p>  <p>   at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)</p>  <p>   at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)</p>  <p>   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)</p>  <p> </p>  <p> </p>  <p>************* Loaded Assemblies *************</p>  <p>mscorlib</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll</p>  <p>--</p>  <p>QueryAsAWebServices</p>  <p>    Assembly Version: 1.0.0.0</p>  <p>    Win32 Version: 1.0.0.0</p>  <p>    CodeBase: file:///C:/Program%20Files/Business%20Objects/Query%20As%20A%20Web%20Service/QueryAsAWebServices.exe</p>  <p></p>  <p>System.Windows.Forms</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll</p>  <p></p>  <p>System</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>System.Drawing</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll</p>  <p></p>  <p>BusinessObjects.Windows.Forms.WebIntelligence</p>  <p>    Assembly Version: 11.7.0.0</p>  <p>    Win32 Version: 11.7.0.0</p>  <p>    CodeBase: file:///C:/Program%20Files/Business%20Objects/Query%20As%20A%20Web%20Service/BusinessObjects.Windows.Forms.WebIntelligence.DLL</p>  <p></p>  <p>BusinessObjects.Windows.Forms.Shared</p>  <p>    Assembly Version: 11.7.0.0</p>  <p>    Win32 Version: 11.7.0.0</p>  <p>    CodeBase: file:///C:/Program%20Files/Business%20Objects/Query%20As%20A%20Web%20Service/BusinessObjects.Windows.Forms.Shared.DLL</p>  <p></p>  <p>System.Web.Services</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.web.services/1.0.5000.0__b03f5f7f11d50a3a/system.web.services.dll</p>  <p></p>  <p>System.Runtime.Serialization.Formatters.Soap</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.runtime.serialization.formatters.soap/1.0.5000.0__b03f5f7f11d50a3a/system.runtime.serialization.formatters.soap.dll</p>  <p></p>  <p>System.Xml</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll</p>  <p></p>  <p>System.Web</p>  <p>    Assembly Version: 1.0.5000.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/system.web/1.0.5000.0__b03f5f7f11d50a3a/system.web.dll</p>  <p></p>  <p>xsupdxis</p>  <p>    Assembly Version: 0.0.0.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>ok6jkwfk</p>  <p>    Assembly Version: 0.0.0.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>jrwwd5gi</p>  <p>    Assembly Version: 0.0.0.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>7isauhvt</p>  <p>    Assembly Version: 0.0.0.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>ysc4stwe</p>  <p>    Assembly Version: 0.0.0.0</p>  <p>    Win32 Version: 1.1.4322.2032</p>  <p>    CodeBase: file:///c:/windows/assembly/gac/1.0.5000.0__b77a5c561934e089/system.dll</p>  <p></p>  <p>SandBar</p>  <p>    Assembly Version: 1.1.1.0</p>  <p>    Win32 Version: 1.1.1.0</p>  <p>    CodeBase: file:///C:/Program%20Files/Business%20Objects/Query%20As%20A%20Web%20Service/SandBar.DLL</p>  <p>--</p>  <p> </p>  <p>************* JIT Debugging **************</p>  <p>To enable just in time (JIT) debugging, the config file for this</p>  <p>application or machine (machine.config) must have the</p>  <p>jitDebugging value set in the system.windows.forms section.</p>  <p>The application must also be compiled with debugging</p>  <p>enabled.</p>  <p> </p>  <p>For example:</p>  <p> </p>  <p><configuration></p>  <p>    <system.windows.forms jitDebugging="true" /></p>  <p></configuration></p>  <p> </p>  <p>When JIT debugging is enabled, any unhandled exception</p>  <p>will be sent to the JIT debugger registered on the machine</p>  <p>rather than being handled by this dialog.</p>

    Hi,
    Your are using QaaWS lab v2 version. I would recommend you switching to Productivity Pack / SP2 it was rtm last week. Error handling in QaaWS client has been improved.
    With QaaWS lab v2, start by checking your server is XI R2 SP1, check user credentials by creating a query with same universe in Web Intelligence, activate log4j traces.

  • Report in Answers using a SQL Query(Sub Query) URGENT

    HI
    Can anyone help me in creating a report in answers using this below query please. Its little Urgent. I have no idea how to implement this, please suggest.
    Select
    a.account_external_id, a.edc_external_id, c.ann_usg, indclassificationcode, g.usage_cv, trunc(g.bill_month, 'mm') bill_month
    from
    crm2ro.cdi_customer_gas_all a, pwrline.account@lodestar_source b, crm2ro.cdi_ann_usg c,
    select * FROM
    select * from
    select distinct d.account_external_id, d.end_date, d.bill_month, USAGE_CV, dense_rank () over (partition by d.account_external_id order by d.end_Date desc) dr
    from
    crm2ro.cdi_usage_gas_all d, crm2ro.cdi_customer_gas_all e
    where
    d.account_external_id = e.account_external_id and upper(e.plan_id) like '%CPS%' and e.product_external_id = 'V' and e.crm_product = 'MV'
    and (e.plan_id like '%VAR_CPS_MX_G%' or e.plan_id like '%VAR_CPS_IT_G%') and e.account_status = 'ACTIVE'
    )where dr<=12
    ) h
    ) g
    where
    a.account_external_id = g.account_external_id and
    a.account_external_id = c.account_external_id and
    a.account_external_id = b.accountid
    thanks
    van

    Yes Jai,
    I want to do it from rpd or from the advance tab as 974053 said. But I am not aware of doing through advance tab and if I want to do through rpd then how can I do it. Please help me how to build this query through rpd or any other solution.

  • How to pass a date parameter from report builder query designer to oracle database

    i'm using report builder 3.0 connected to oracle database. i'm trying to pass a date parameter in the query with no success, i don't
    know the exact syntax. I've tried :
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date('01/01/2014','mm/dd/yyyy')
    it worked perfectly.
    However if i try to put a date parameter "From" instead of 01/01/2014 it will not work, a Define Query Parameter popup window appear and error occurred after i fill
    the values (usually i shouldnt get this popup i should enter the value when i run the report)
    SELECT * FROM igeneral.GCL_CLAIMS where CREATED_BY IN (:CREATED_BY) AND CLAIM_YEAR IN(:UW_YEAR) AND (LOSS_DATE) >To_Date(:From,'mm/dd/yyyy')
    appreciate your assistance

    Hi Gorgo,
    According to your description, you have problem when in passing a parameter for running a Oracle Query. Right?
    Based on my knowledge, it use "&" as synax for parameter in Oracle, like we use "@" in SQL Server. In this scenario, maybe you can try '01/01/2014' when inputing in "From". We are not sure if there's any limitation for To_Date()
    function. For your self-testing, you can try the query in sqlplus/sql delveloper. Since your issue is related to Oracle query, we suggest you post this thread onto Oracle forum.
    Best Regards,
    Simon Hou

  • Get data for current month in VC from query - Urgent

    Hi all,
    I have designed a query for cube FIAR_C03 for overdue items and query output contains customer, net due date, document date, fiscal year period and amount. I want a chart for that query in VC that only contains those items in which net due date is in current month. How can i do that?
    Where I can place the condition to display only those items in vc in which net due date is in current month and how ?
    Please respond.
    Regards,
    Aisha Ishrat
    ICI Pakistan Ltd.

    Hi Aisha,
    It is possible to do with following steps:
    1. In Query Design make your field 'Net Due' filter with variable for date input (0CALMONTH for example where your date should be this format MMYYYY). Test your query and see if you input a month/year date it would would work;
    2. Build one table from output of your query (choose fields);
    3. In Visual Composer, drag your query into your board and from 'Varaiables' port  (NOT FROM INPUT) drag a line to create a Start point. As soon you realease to create 'Start' a box will ask which fields you want. Choose your date as field;
    4. Select the line between Start point a query. In Input Field assigned the following formula (DSTR(NOW(),'MMYYYY') *
    5. Deploy your model
    at this formula I said: transform NOW(), current date, in Text with format MMYYYY (012002 for example).
    It works!
    Assigned points if was helpful.
    Kind Regards,
    Gilson Teixeira

  • Help needed in building query

    Tab1
    Parent       Child       sa l
    P1     A1       4000
    A1     A       1000
    A1     B       4000
    A     X       1000
    A     Y         2000
    B     X1        1000           
    B     X2       3000I need to build a query that will retrieve the value for each child as the sum of the salaries of all its child in a single query.
    That is
    For Sal P1 = Sal A1 + all child of A1 and its child
         For A1 = Sal A1 + all child of A1 and its child ( A+B+X+Y+X1+X2)
    Like it should sho all the records with the count .. please help

    This is not so simple since it is not really clear in your data set whether the sal belongs to the parent or to the child. I assume it's the salary of the child, in which case the salary of P1 is missing. The best option is to fix the data model and have two tables: one containing the element and sal, and another table containing just the relationships. To fix this issue I introduced a dummy record for P1 and salary 0.
    SQL> with t2 as
      2  ( select connect_by_root(child) cbr
      3         , sal
      4      from (select * from t union all select null,'P1',0 from dual)
      5   connect by parent = prior child
      6  )
      7  select cbr child
      8       , sum(sal)
      9    from t2
    10   group by cbr
    11  /
    CHILD    SUM(SAL)
    X1           1000
    A1          16000
    X2           3000
    P1          16000
    Y            2000
    X            1000
    A            4000
    B            8000
    8 rows selected.Regards,
    Rob.

  • Enterprise bpm cluster query urgent please

    Hello
    I have 3 machines one 1st machine it is admin server and other 2 are managed servers
    I will install weblogic on all 3 machines and then create a domain but my query is to do with BPM enterprise.Should I install bpm enterprise on all 3 machines as well or just on 1 machine(admin machine/1st machine) ? this is my doubt can you please clarify..
    it is pretty urgent
    thanks

    With one machine is enough, then you will deploy to the WLS cluster at the end of the day you do not need to have BPM installed except for the Process Administrator.
    HTH

  • How to add a dynamic table name in Report Builder Query ?

    I have some problem while creating a report in report builder 6i.
    My data is managed as in tables like this abc_012006, abc_022006 etc , so I want to query data according to the month user have selected from the parameter form. Let suppose if user entered 012006 as month year then data must be fetched from abc_012006.
    Can any one tell me the appropriate tip for this problem.
    Message was edited by:
    [email protected]

    Hello,
    Once you get the Data Set create save it as XML and then create a new report off the XML file. Then you can set the data set to the report and the XML is not required any more.
    First, to be able add fields to a report you need to use RAS. Report.Engine doesn't have the ability.
    If you search in this forum you will find lots of examples on how to...
    If you want to create the report then see these RAS samples:
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETRASSDK+Samples#NETRASSDKSamples-Exporting%2FPrinting
    Don

  • In line SQL Query - Urgent

    In the problem iam calculating a Stock report.In the SQL suppose the relation F does not return any rows , then (D.ACC_QTY + F.RET_QTY) gives null. How to avoid this problem..
    SELECT A.CLASSIFICATION_CODE, A.ITEM_ABBR, A.ITEM_DESC,
    A.ALT_ITEM_CODE, A.UOM_DESC, A.BASIC_PRICE,
    (A.OPENING_QTY + B.ACC_QTY - C.ISS_QTY)
    OPENING_STOCK, (D.ACC_QTY + F.RET_QTY) ACCEPT_QTY, E.ISS_QTY,
    ((A.OPENING_QTY + B.ACC_QTY - C.ISS_QTY)
    + (D.ACC_QTY + F.RET_QTY) - E.ISS_QTY)
    QTY_IN_HAND
    FROM (SELECT CLASSIFICATION_CODE, ITEM_ABBR, ITEM_DESC,
    ALT_ITEM_CODE, NVL(OPENING_QTY, 0)
    OPENING_QTY, UOM_MASTER.UOM_DESC,
    BASIC_PRICE
    FROM ITEM_MASTER, UOM_MASTER
    WHERE ITEM_MASTER.UOM_CODE = UOM_MASTER.UOM_CODE)
    A,
    (SELECT GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE < '01-JAN-2006'
    GROUP BY GRN_DETAIL.ITEM_CODE) B,
    (SELECT MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE < '01-JAN-2006'
    GROUP BY MRN_DETAIL.ITEM_CODE) C,
    (SELECT GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY GRN_DETAIL.ITEM_CODE) D,
    (SELECT MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY MRN_DETAIL.ITEM_CODE) E,
         (SELECT B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE,0))
    RET_QTY
    FROM MATERIAL_MOVEMENT_HEADER A,MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006' AND
              B.TO_JOB_CODE IS NULL
    GROUP BY B.ITEM_CODE) F
    WHERE A.ALT_ITEM_CODE = B.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = C.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = D.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = E.ITEM_CODE (+) AND
         A.ALT_ITEM_CODE = F.ITEM_CODE (+) AND
         A.ALT_ITEM_CODE LIKE 'BOBRNG%017' AND
    A.CLASSIFICATION_CODE = 'BO';

    Sorry members for writing the word 'Urgent'..and really cutting down on your work.
    I am thankful to the person who pointed out my error in the query..it was really simple..should hv solved myself, but even after changing the query with Nvl and changing the business logic to some extent it again fetches no rows..
    The sql given underneath is basically a job-wise stock allocation report..
    SELECT B.JOB_CODE, A.CLASSIFICATION_CODE, A.ITEM_ABBR,
    A.ITEM_DESC, A.ALT_ITEM_CODE, A.UOM_DESC,
    A.BASIC_PRICE, (A.OPENING_QTY + (NVL(B.ACC_QTY, 0)
    + NVL(F.RET_IN, 0)) - (NVL(C.ISS_QTY, 0) + NVL(G.RET_OUT,
    0))) AS OPENING_STOCK, (NVL(D.ACC_QTY, 0)
    + NVL(H.RET_IN, 0)) RECEIVED, (NVL(E.ISS_QTY, 0)
    + NVL(I.RET_OUT, 0)) ISSUED,
    ((A.OPENING_QTY + (NVL(B.ACC_QTY, 0) + NVL(F.RET_IN, 0))
    - (NVL(C.ISS_QTY, 0) + NVL(G.RET_OUT, 0)))
    + (NVL(D.ACC_QTY, 0) + NVL(H.RET_IN, 0)) - (NVL(E.ISS_QTY,
    0) + NVL(I.RET_OUT, 0))) QTY_IN_HAND
    FROM (SELECT CLASSIFICATION_CODE, ITEM_ABBR, ITEM_DESC,
    ALT_ITEM_CODE, UOM_MASTER.UOM_DESC,
    BASIC_PRICE, 0 OPENING_QTY
    FROM ITEM_MASTER, UOM_MASTER
    WHERE ITEM_MASTER.UOM_CODE = UOM_MASTER.UOM_CODE)
    A,
    (SELECT GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE < '01-JAN-2006'
    GROUP BY GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE) B,
    (SELECT B.TO_JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_IN
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE < '01-JAN-2006'
    GROUP BY B.TO_JOB_CODE, B.ITEM_CODE) F,
    (SELECT MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE < '01-JAN-2006'
    GROUP BY MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE) C,
    (SELECT B.JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_OUT
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE < '01-JAN-2006'
    GROUP BY B.JOB_CODE, B.ITEM_CODE) G,
    (SELECT GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE,
    SUM(NVL(GRN_DETAIL.ACCEPT_QTY, 0))
    ACC_QTY
    FROM GRN_HEADER, GRN_DETAIL
    WHERE GRN_HEADER.GRN_NO = GRN_DETAIL.GRN_NO AND
    GRN_HEADER.GRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY GRN_HEADER.JOB_CODE,
    GRN_DETAIL.ITEM_CODE) D,
    (SELECT B.TO_JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_IN
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN '01-JAN-2006' AND
    '31-DEC-2006'
    GROUP BY B.TO_JOB_CODE, B.ITEM_CODE) H,
    (SELECT MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE,
    SUM(NVL(MRN_DETAIL.ISSUED_QTY, 0))
    ISS_QTY
    FROM MRN_HEADER, MRN_DETAIL
    WHERE MRN_HEADER.MRN_NO = MRN_DETAIL.MRN_NO AND
    MRN_HEADER.MRN_DATE BETWEEN
    '01-JAN-2006' AND '31-DEC-2006'
    GROUP BY MRN_HEADER.JOB_CODE,
    MRN_DETAIL.ITEM_CODE) E,
    (SELECT B.JOB_CODE, B.ITEM_CODE,
    SUM(NVL(B.QUANTITY_ISSUE, 0)) RET_OUT
    FROM MATERIAL_MOVEMENT_HEADER A,
    MATERIAL_MOVEMENT_DETAIL B
    WHERE A.SLIP_NO = B.SLIP_NO AND
    A.SLIP_DATE BETWEEN '01-JAN-2006' AND
    '31-DEC-2006'
    GROUP BY B.JOB_CODE, B.ITEM_CODE) I
    WHERE A.ALT_ITEM_CODE = B.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = C.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = D.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = E.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = F.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = G.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = H.ITEM_CODE (+) AND
    A.ALT_ITEM_CODE = I.ITEM_CODE (+) AND
    B.JOB_CODE = C.JOB_CODE AND
    B.JOB_CODE = D.JOB_CODE AND
    B.JOB_CODE = E.JOB_CODE AND
    B.JOB_CODE = F.TO_JOB_CODE AND
    B.JOB_CODE = G.JOB_CODE AND
    B.JOB_CODE = H.TO_JOB_CODE AND
    B.JOB_CODE = I.JOB_CODE AND
    A.ALT_ITEM_CODE = 'BOSNVL0004-006-002';
    regards,

  • Need help wrt query urgently

    Hi ,
    I have two tables "table1" and "table2".Structure of the both tables are below:
    Table1:
    CustomerId
    CustFname
    CustLname
    Convertion_Date
    Table2:
    CustomerId
    DFname
    DLname
    CustomerId is used for joins .
    Now i need a query based on conversion_date.
    If conversion_date <sysdate
    then
    select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
    else
    select CustomerId,DFname,DLname from Table2
    End .
    I need this functionality in a single query using case statement.
    Please help ..
    Thanks,
    Preethi MR

    Preethi MR wrote:
    Hi ,
    I have two tables "table1" and "table2".Structure of the both tables are below:
    Table1:
    CustomerId
    CustFname
    CustLname
    Convertion_Date
    Table2:
    CustomerId
    DFname
    DLname
    CustomerId is used for joins .
    Now i need a query based on conversion_date.
    If conversion_date <sysdate
    then
    select CustomerId ,CustFname,CustLname,Convertion_Date from Table1
    else
    select CustomerId,DFname,DLname from Table2
    End .
    I need this functionality in a single query using case statement.
    Please help ..
    Thanks,
    Preethi MRIs this urgent homework? Or urgent something else work?
    What exactly makes it urgent?

  • Create script (Procedure?) to help build query in app?

    Hi,
    Working with SQL 2012 Express and C# WinForms.
    Sorry, not experience with Procedures/Functions stored within DB.
    Wondering if it's possible to create a script (Function or Procedure?) to build only "part" of a sql query and then use the output (returned string) in my C# query to complete it.
    Thanks,
    Ron

    can you elaborate? what part  comes from C#?
    Please Mark This As Answer if it solved your issue
    Please Mark This As Helpful if it helps to solve your issue
    Visakh
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How u guys build query in program

    Hey guys,
    i was wondering how u guys build queries in the program. i mean if you use String or StringBuffer. e.g.
    SELECT * FROM MY_TABLE WHERE X=someValue and Y=someValue and Z= someValue. if i use String i have to use + operator to get the values at runtime and which causes problem with performence. and when i use StringBuffer its kind of cumbersome. whats the best way you guys find for building queries at run time.
    appreciate the time you have taken to read this.
    take care and have a good day.

    Hi
    yes i'm creating the query in a loop. query is very
    big like 2 page long. basically i've to join data from
    many tables and many filter criteria entered by the
    clients which i put in the where clause. we r running
    optimizers on our application and it shows query
    building processes are making the overall performence
    slow.
    First you limit the query in some fashion (if you don' t then you might as well just give them a text box and let them type SQL.)
    In your case that might be limiting it to a query on all of the five tables.
    Second you produce a query DTO.
    A standard DTO might look like this....
           class CustomerDTO
             public String customerName;
             public double accountBalance;
      A query DTO, built to match the above, would look like this....
           class CustomerQueryDTO
             public String customerName1;
             public String customerName2;
             public OperatorType customerNameOperator;
            public double accountBalance1;
            public double accountBalance2;
            public OperatorType accountBalanceOperator;
          }And OperatorType would allow equality, between (which is why there are two parameters), greater than, etc
    You build the query string as follows
           CustomerQueryDTO query = ...
           StringBuffer b = new StringBuffer();
           b.append("select ");
           b.append(fieldList);
           b.append(" from ");
           b.append(tableList);
           b.append("where 1=1");
           if (query.customerNameOperator != null)
                b.append(" and ");
                String exp = createExpression(query.customerName1,
                                       query.customerName2,
                                       query.customerNameOperator );
                b.append(exp);
         String sql = b.toString(); 
    You also want to make sure that a query actually is limited by something. So the query must have at least one clause.

Maybe you are looking for

  • How to update the sent mail using SO_NEW_DOCUMENT_ATT_SEND_API1

    I have a requirement to update/ append the sent mail like a trail.Since i am sending mails using SO_NEW_DOCUMENT_ATT_SEND_API1, how can i update new contents to sent mails using this RFC???Please help me.

  • Why does apple not allow me to transfer software from one apple ID to another.

    I did some work for an organization that paid me by purchasing FCPX. They figured that since they were logging into my computer the software would be linked to my account/user logged into the computer at the time. Since they logged into their APPLE I

  • Video funktion impossible

    Hello ! I have the following problem with my iPod and itunes: I have install the quick time player and i have bought the quick time pro 7. When I start the itunes for copie a video over itunes to may iPod I cannot change the Attitudes in itunes. All

  • APPLE : IPOD UPDATE 1.2 HAS KILLID MY 5G 60GB

    Guys, the very least you could do is say yo know you messed up and do the following . 1. Release a 'rollback' fix that will put the ipod firmware back to pre 1.2 state 2. Get the firmware right for once, this is the third time n 10 months I've update

  • Sizing of GP

    Hi, are there any information’s about sizing of GP? This means answers for questions like: How many users can use simultaneously the GP? How many running/completed processes/actions are supported by a system? How many parallel dynamic steps can be ex