Need help in query to have all items in sap with PO data on order, date

Hello Everyone,
I need some help in writing a query to show all items in sap db to have itemcode, itemname, onhand, sellable(onhand-committed), on order, and the delivery date when that time should be received.  I need to know what items are regular items, which ones are master and components.  For the master I need to have the deliver date of the PO for the component.
I have written this.
SELECT DISTINCT TOP (100) PERCENT T1.ItemCode, SUM(T1.Sellable) AS Sellable, T1.OnOrder, MAX(T1.Docduedate) AS DeliveryDate, T1.WhsCode
FROM         (SELECT     ItemCode, Sellable, OnOrder, '1/1/1900' AS Docduedate, WhsCode
                       FROM          dbo.V_RAZ_StoreInv
                       UNION ALL
                       SELECT     TOP (100) PERCENT ItemCode, '0' AS Sellable, Quantity AS Onorder, DocDueDate, WhsCode
                       FROM         dbo.V_RAZ_OPENPOSDATA
                       ORDER BY ItemCode) AS T1 LEFT OUTER JOIN
                      dbo.V_RAZ_ItemInfo ON T1.ItemCode = dbo.V_RAZ_ItemInfo.ItemCode
GROUP BY T1.ItemCode, T1.OnOrder, T1.WhsCode, dbo.V_RAZ_ItemInfo.OnHold
HAVING      (dbo.V_RAZ_ItemInfo.OnHold = 'n')
ORDER BY T1.ItemCode, T1.WhsCode
and for the v_raz_openposdata I have the following query
SELECT     dbo.OPOR.DocNum, dbo.OPOR.DocStatus, dbo.POR1.WhsCode, dbo.POR1.ItemCode, dbo.POR1.Dscription, dbo.POR1.Quantity, dbo.POR1.OpenQty,
                      dbo.POR1.LineStatus, dbo.OPOR.DocDueDate
FROM         dbo.OPOR LEFT OUTER JOIN
                      dbo.POR1 ON dbo.OPOR.DocEntry = dbo.POR1.DocEntry
WHERE     (dbo.OPOR.DocStatus = 'O')
Any help is greatly appreciated. 
Right now I do get the delivery date for regular items and components but the master sku for the component all of them have 1/1/1900. 
Thank you

Thank you for replying Gordon.  I did not remember I had asked this before.  I no longer have access to the other account. 
What I need on the query is that I want  a list of items with the on order quantity and when we are expecting this order to be received.  The receiving date is based on the PO delivery date.  The trick here is that  I need to Master sku to show the delivery date of the component sku.  In my scenario all components have the same delivery date for the Master sku.  If there are mulitple delivery dates because each warehouse is getting them on a different date then I want to get the delivery date for that warehouse.
Let me know if this is possible and if yes please guide towards a query for it.
Thank you.

Similar Messages

  • Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset pref

    Need help. I am running a 27 in imac with 16 gigs of ram. Photoshop runs really fast, except when opening files. It takes 5-10 minutes to open even a small file of 1 meg. I cleaned and validated all the fonts and removed all questionable fonts. Reset preferences and still have problem. Slow to open and in force quit "Photoshop not responding" At this point should I uninstall and start over.

    What are the performance Preferences?

  • Need Help to query Lync Database for User Information

    Need Help to Query the lync database to retrieve below user information.
    1. SIP Address of the registered user
            2. Phone Number configured to the particular account.
            3. IP Address
           4. Last Logged in time.
    I am trying to pull the above information from rtc database for all the registered users. Please let me know if this is possible and it would be great if you can throw some light on what tables to look for the data. Thank You.

    Hi,
    For SIP address and Phone number you can check RTC database.
    IP Address:
    You can refer to the link below to query IP address: 
    http://h30499.www3.hp.com/t5/Business-Service-Management-BAC/Monitoring-Lync-with-the-User-Registrations-Viewer-Free-NMC-tool/ba-p/5961497#.UtOU43mIrwo
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    Last Logged in time:
    You can refer to the link below:
    http://blogs.technet.com/b/dodeitte/archive/2011/05/11/how-to-get-the-last-time-a-user-registered-with-a-front-end.aspx
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • Hi there, I need help .. I have 2 gen ipod touch and I restore my ipod around 11:00 pm and now its 1:20 am and on my screen its the iTunes logo and the usb cord and when I plug my charger in my laptop .. iTunes comes up and this what it saids "iTunes has

    hi there, I need help .. I have 2 gen ipod touch and I restore my ipod around 11:00 pm and now its 1:20 am and on my screen its the iTunes logo and the usb cord and when I plug my charger in my laptop .. iTunes comes up and this what it saids "iTunes has detected an ipod recovery mode. you must restore this ipod before it can be used with iTunes" so what do I do.. do I let my ipod died right out & then try it .. because I restore it ,... it was beening to slow... so please help me  ?

    Maybe:
    Restore loop (being prompted to restore again after a restore successfully completes)
    Troubleshoot your USB connection. If the issue persists, out-of-date or incorrectly configured third-party security software may be causing this issue. Please follow Troubleshooting security software issues. .
    Next try placing in DFU mode and then restoring.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    Then try restoring on another computer.
    Last, make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • I need help please. I have 6 apps updates shown on on the upper right corner of the app store icon. When i tried to open the apps store and go to updates, the apps that need to be updated were not appearing therefore i have no idea what those apps

    I need help please. I have 6 apps updates shown on on the upper right corner of the app store icon. When i tried to open the apps store and go to updates, the apps that need to be updated were not appearing therefore i have no idea what those apps are so that i can update them. Please give some solutions please

    isthisonetaken wrote:
    I'm having this problem. It started yesterday. I have 2 updates, but when I open the App Store, they won't appear.
    Do you have apps purchased with a differnt AppleID?
    For example, mine shows 12 updates but only 2 show up as being available.
    The others are on my daughters account.
    I log out of my iTunes account and log in with hers and those updates show up.

  • I forgot my answers to my security questions and I'm not receiving my reset email I need help soon because I have $15 on my account please help ASAP

    I forgot my answers to my security questions and I'm not receiving my reset email I need help soon because I have $15 on my account please help ASAP

    See Kappy’s great User Tips.
    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities
    https://discussions.apple.com/docs/DOC-4551
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us http://www.apple.com/emea/support/itunes/contact.html
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service http://support.apple.com/kb/HE57
    About Apple ID security questions
    http://support.apple.com/kb/HT5665
     Cheers, Tom

  • Any function module to get all items in SAP INBOX

    hi All
    I am trying to get all the items in my SAP Inbox via rfc.
    Can anyone help me with any function module to get all items in SAP INBOX.
    Thanks

    Hi Mukesh,
    Step 1. Use FM SO_USER_READ_API1 to get the folder details of the user
    Step 2. Use FM SO_FOLDER_READ_API1 of the respective folder. You can read the Inbox, Workflow Inbox depending on what folder you read. The function modules are documented well as well with examples.
    Hope this will  help u,
    Thanks & Regards
    Kiran

  • Please can you help me? I have a Mac Book Pro with OS X 10.7.4 and my FaceTime doesn't open anymore. It appears this sentence:"the server detected an error during the elaboration of the registration. Please try later". What happens??

    Please can you help me? I have a Mac Book Pro with OS X 10.7.4 and my FaceTime doesn't open anymore. It appears this sentence:"the server detected an error during the elaboration of the registration. Please try later". What happens??

    Start the computer from the installation disk and perform Repair Disk and Repair Permissions using Disk Utility

  • Need help on displaying the callers name on ip phone with cme using external directory

    Hello Guys,
    Need help on displaying the callers name on ip phone with cme while using external directory
    Thank you,
    Khaja

    Thanks for your help,
    Does it 100% work with CME. We use SIP and 2ring for external directory?  Thanks you.

  • HT4865 I need help findin my sons iPod n I set up with different iCloud account n never installed find my device n location map is off how do I locate device

    I need help findin my sons iPod n I set up with different iCloud account n never installed find my device n location map is off how do I locate device

    Jenniferp27.jp wrote:
    ...n never installed find my device n location map is off how do I locate device
    Then you cannot locate it electronically.
    What to do if your iOS device is lost or stolen
    http://support.apple.com/kb/HT5668

  • How to create item wise invoice with reference to sales order.

    Hi ,
    Please let me know how to create item wise invoice with reference to sales order.
    Ex : Sales order has 2 line items .
              When creating invoice system should create two invoices for each line items.
    I have tried with copy control but I am not able to do it.
    Please advise.
    Regards

    Hi,
    Please let us know your exact requirement. Whether you want it to be fixed like only one line item to be billed every time ot it to be based on selection you do every time.
    As per my understanding it should not be fixed and in that case it should like as follows,
    In VF01 you will select Del. document/S.O. number and click on selection list and will take you to next screen as mention below,
    and select desire line item to be billed and click on copy and will take you to billing screen.
    Regards,
    Ajit K Singh

  • HT201272 After my upgrade to ios6 I lost all my purchased books. I have tried to retrieve without luck. I have followed ever tip including the one above. I do not have a purchased books line. I need help. I should have never upgraded.

    I cannot locate my purchased books after upgrade. I have tried every forum response with no luck. I go to itunes and the want me to pay for the books again.
    Any help would be appreciated.

    The ibooks were bought via the same account as you are currently logged in with and they were bought whilst you were in the same country ? And they don't show on either the Purchased tab in the iBooks app nor the Purchased link on your computer's iTunes, and they aren't in the Books part of your library ? You could also check to see if they are hidden : hiding and unhiding .

  • Need help in query to display lot and serial numbers for a Wip Job Component

    Hi ALL,
    I have a requirement as below.
    I need to display lot and serial numbers for a Wip Job Component, i have a xml report in that for each wip job component i need to check whether it is a lot control item or serial control item based on that i need to display some data. so can you please help me to get the query to indentify the lot and serial number for a wip job component.
    Thanks

    Thank you for replying Gordon.  I did not remember I had asked this before.  I no longer have access to the other account. 
    What I need on the query is that I want  a list of items with the on order quantity and when we are expecting this order to be received.  The receiving date is based on the PO delivery date.  The trick here is that  I need to Master sku to show the delivery date of the component sku.  In my scenario all components have the same delivery date for the Master sku.  If there are mulitple delivery dates because each warehouse is getting them on a different date then I want to get the delivery date for that warehouse.
    Let me know if this is possible and if yes please guide towards a query for it.
    Thank you.

  • Need help in query tuning

    Hi All,
    In my application I have 3 tables. Event(1.2 L records), KeyWord(1K records) and Event_KeyWord_Mapping(1.4 L records) table.
    In my query i need to sort the Events table by 3 columns -( 1 Date column and 2 String column) and i am interested only in top 40 records.
    Below is the example query.
    select
        from
            (    select
                      a.*,
                ROWNUM    
            from
                (    select
                    distinct event_id   
                from
                    (     select
                        (this_.EVENT_ID),
                        this_.EVENT_GMT_DATE ,
                        this_.PRIORITY    
                    from
                        EVENTS this_,
                        event_keyword_mapping ekp 
                    where
                        this_.EVENT_ID = ekp.event_id
                        AND  ekp.keyword_id IN (
                            1643,2278,24,1090,2422,401 )
                        AND (
                                EVENT_CODE = 'IEP'
                                AND (
                                    IS_SCALL = 'Y'
                                    AND  COUNTRY_DISPLAY IN (
                                        'US','CA','UK','BE','FR','DE','IT','JP','AU','CH','EU'
                        OR (
                                EVENT_CODE = 'ICC'
                                AND IS_GTINDEX = 'Y'
                        AND  FX_EVENT = 'N' 
                        AND  EVENT_GMT_DATE BETWEEN to_date('12/27/2011 05:14:00','mm/dd/yyyy HH24:MI:SS')and
    to_date('03/27/2012 10:28:44','mm/dd/yyyy HH24:MI:SS')
                    ORDER BY
                        EVENT_GMT_DATE ASC  ,
                        PRIORITY ASC  ,
                        EVENT_ID ASC )) a 
                where
                    ROWNUM<=41)(1643,2278,24,1090,2422,401) keywords have 90K+ mappings.
    Below is the explain plan for the above query.
    | Id  | Operation                               | Name                           | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |                                                                                                                                                                         
    |   0 | SELECT STATEMENT                        |                                |    41 |  1066 |       |   629K (85)| 02:05:51 |                                                                                                                                                                         
    |   1 |  VIEW                                   |                                |    41 |  1066 |       |   629K (85)| 02:05:51 |                                                                                                                                                                         
    |*  2 |   COUNT STOPKEY                         |                                |       |       |       |            |          |                                                                                                                                                                         
    |   3 |    VIEW                                 |                                | 25738 |   326K|       |   629K (85)| 02:05:51 |                                                                                                                                                                         
    |*  4 |     SORT GROUP BY STOPKEY               |                                | 25738 |   955K|  6929M|   629K  (2)| 02:05:51 |                                                                                                                                                                         
    |   5 |      CONCATENATION                      |                                |       |       |       |            |          |                                                                                                                                                                         
    |   6 |       MERGE JOIN CARTESIAN              |                                |   150M|  5463M|       | 96245   (2)| 00:19:15 |                                                                                                                                                                         
    |   7 |        TABLE ACCESS BY INDEX ROWID      | EVENTS                         |  1132 | 32828 |       |  1618   (1)| 00:00:20 |                                                                                                                                                                         
    |   8 |         BITMAP CONVERSION TO ROWIDS     |                                |       |       |       |            |          |                                                                                                                                                                         
    |   9 |          BITMAP AND                     |                                |       |       |       |            |          |                                                                                                                                                                         
    |  10 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |  11 |            SORT ORDER BY                |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 12 |             INDEX RANGE SCAN            | EVT_PRIORITY_GMT_DATE_ID_INDEX | 30402 |       |       |    68   (0)| 00:00:01 |                                                                                                                                                                         
    |  13 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 14 |            INDEX RANGE SCAN             | EVENT_CODE_INDEX               | 30402 |       |       |    79   (0)| 00:00:01 |                                                                                                                                                                         
    |  15 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 16 |            INDEX RANGE SCAN             | FX_EVENT_INDEX                 | 30402 |       |       |   102   (1)| 00:00:02 |                                                                                                                                                                         
    |  17 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 18 |            INDEX RANGE SCAN             | IS_GTINDEX_INDEX               | 30402 |       |       |   102   (1)| 00:00:02 |                                                                                                                                                                         
    |  19 |        BUFFER SORT                      |                                |   133K|  1170K|       | 94627   (2)| 00:18:56 |                                                                                                                                                                         
    |  20 |         TABLE ACCESS FULL               | EVENT_KEYWORD_MAPPING          |   133K|  1170K|       |    84   (3)| 00:00:02 |                                                                                                                                                                         
    |* 21 |       HASH JOIN                         |                                |  6691 |   248K|       |  2489   (1)| 00:00:30 |                                                                                                                                                                         
    |* 22 |        TABLE ACCESS BY INDEX ROWID      | EVENTS                         |  1937 | 56173 |       |  2401   (1)| 00:00:29 |                                                                                                                                                                         
    |  23 |         BITMAP CONVERSION TO ROWIDS     |                                |       |       |       |            |          |                                                                                                                                                                         
    |  24 |          BITMAP AND                     |                                |       |       |       |            |          |                                                                                                                                                                         
    |  25 |           BITMAP OR                     |                                |       |       |       |            |          |                                                                                                                                                                         
    |  26 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 27 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  28 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 29 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  30 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 31 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  32 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 33 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  34 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 35 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  36 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 37 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  38 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 39 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  40 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 41 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  42 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 43 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  44 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 45 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  46 |            BITMAP CONVERSION FROM ROWIDS|                                |       |       |       |            |          |                                                                                                                                                                         
    |* 47 |             INDEX RANGE SCAN            | COUNTRY_DISPLAY_INDEX          | 30402 |       |       |     3   (0)| 00:00:01 |                                                                                                                                                                         
    |  48 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 49 |            INDEX RANGE SCAN             | EVENT_CODE_INDEX               | 30402 |       |       |    79   (0)| 00:00:01 |                                                                                                                                                                         
    |  50 |           BITMAP CONVERSION FROM ROWIDS |                                |       |       |       |            |          |                                                                                                                                                                         
    |* 51 |            INDEX RANGE SCAN             | IS_SCALL_INDEX                 | 30402 |       |       |   100   (1)| 00:00:02 |                                                                                                                                                                         
    |* 52 |        TABLE ACCESS FULL                | EVENT_KEYWORD_MAPPING          | 88609 |   778K|       |    87   (4)| 00:00:02 |                                                                                                                                                                         
    Predicate Information (identified by operation id):                                                                                                                                                                                                                                                        
       2 - filter(ROWNUM<=41)                                                                                                                                                                                                                                                                                  
       4 - filter(ROWNUM<=41)                                                                                                                                                                                                                                                                                  
      12 - access("EVENT_GMT_DATE">=TO_DATE(' 2011-12-27 05:14:00', 'syyyy-mm-dd hh24:mi:ss') AND "EVENT_GMT_DATE"<=TO_DATE('                                                                                                                                                                                  
                  2012-03-27 10:28:44', 'syyyy-mm-dd hh24:mi:ss'))                                                                                                                                                                                                                                             
           filter("EVENT_GMT_DATE"<=TO_DATE(' 2012-03-27 10:28:44', 'syyyy-mm-dd hh24:mi:ss') AND "EVENT_GMT_DATE">=TO_DATE('                                                                                                                                                                                  
                  2011-12-27 05:14:00', 'syyyy-mm-dd hh24:mi:ss'))                                                                                                                                                                                                                                             
      14 - access("EVENT_CODE"='ICC')                                                                                                                                                                                                                                                                          
      16 - access("FX_EVENT"='N')                                                                                                                                                                                                                                                                              
      18 - access("IS_GTINDEX"='Y')                                                                                                                                                                                                                                                                            
      21 - access("THIS_"."EVENT_ID"="EKP"."EVENT_ID")                                                                                                                                                                                                                                                         
      22 - filter(LNNVL("EVENT_CODE"='ICC') OR LNNVL("IS_GTINDEX"='Y') OR LNNVL("FX_EVENT"='N') OR                                                                                                                                                                                                             
                  LNNVL("EVENT_GMT_DATE">=TO_DATE(' 2011-12-27 05:14:00', 'syyyy-mm-dd hh24:mi:ss')) OR LNNVL("EVENT_GMT_DATE"<=TO_DATE('                                                                                                                                                                      
                  2012-03-27 10:28:44', 'syyyy-mm-dd hh24:mi:ss')))                                                                                                                                                                                                                                            
      27 - access("COUNTRY_DISPLAY"='AU')                                                                                                                                                                                                                                                                      
      29 - access("COUNTRY_DISPLAY"='BE')                                                                                                                                                                                                                                                                      
      31 - access("COUNTRY_DISPLAY"='CA')                                                                                                                                                                                                                                                                      
      33 - access("COUNTRY_DISPLAY"='CH')                                                                                                                                                                                                                                                                      
      35 - access("COUNTRY_DISPLAY"='DE')                                                                                                                                                                                                                                                                      
      37 - access("COUNTRY_DISPLAY"='EU')                                                                                                                                                                                                                                                                      
      39 - access("COUNTRY_DISPLAY"='FR')                                                                                                                                                                                                                                                                      
      41 - access("COUNTRY_DISPLAY"='IT')                                                                                                                                                                                                                                                                      
      43 - access("COUNTRY_DISPLAY"='JP')                                                                                                                                                                                                                                                                      
      45 - access("COUNTRY_DISPLAY"='UK')                                                                                                                                                                                                                                                                      
      47 - access("COUNTRY_DISPLAY"='US')                                                                                                                                                                                                                                                                      
      49 - access("EVENT_CODE"='IEP')                                                                                                                                                                                                                                                                          
      51 - access("IS_SCALL"='Y')                                                                                                                                                                                                                                                                              
      52 - filter("EKP"."KEYWORD_ID"=24 OR "EKP"."KEYWORD_ID"=401 OR "EKP"."KEYWORD_ID"=1090 OR "EKP"."KEYWORD_ID"=1643 OR                                                                                                                                                                                     
                  "EKP"."KEYWORD_ID"=2278 OR "EKP"."KEYWORD_ID"=2422)                                                                                                                                                                                                                                           When the above query is executed its taking around 10 seconds to return the data.
    I am using- Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
    I need help in bringing down the query execution time.
    Thanks,
    Girish G

    A few questions:
    1. Are any indexes available on the Event_KeyWord_Mapping table?
    2. What does '1.4 L records' mean? Not familiar with 'L'.
    3. Are the statistics up to date for the tables and indexes involved?
    4. Are EVENT_ID and KEYWORD_ID the only columns accessed from the Event_KeyWord_Mapping table?
    Assuming the above then DarkStargate's suggestion is on point.
    But you should add the KEYWORD_ID column to the index as well since that is what the index records are filtered on.
    AND  ekp.keyword_id IN (
                            1643,2278,24,1090,2422,401 )Be sure that index statistics are collected; they will provide Oracle with data about the distribution of KEYWORD_ID values.
    This will allow Oracle to get the required information from the index without accessing the Event_KeyWord_Mapping table itself.

  • Need Help Displaying Query

    I am having problems with this, I need to re-write this into
    3 different routes the CFIF can take. Currently this works because
    the query only returns 9 records, they are being displayed as 3
    rows with 3 columns. I need to re-write and have it where if the
    record count is LT9 to only have the output be on 2 columns with 3
    rows....and if the count is LT6 then i only want 1 row with 3
    columns. I am having problems figuring out how to modify this code
    to accomplish this task. Any help would be greeeeeeeeeeeeat.
    <cfif alsobought_counter LTE 9>
    <cfif (prodCount+(detailsColCount-1)) MOD detailsColCount
    EQ 0><div class="clearfix"></cfif>
    <div class="productThumbCont">
    <cfset product_link = link("product",
    alsoBought_product_id, product_title)>
    <div class="productThumbImg">
    <a href="#product_link#" class="picksLink"
    title="#linktitle#"><img
    src="#cfimage[alsobought_counter].thumb.path#" alt="" border="0"
    tooltip="#alsoBought_product_id#" />
    <cfif len(trim(qryAlso_Bought.is_ondemand)) and
    qryrelated_products.is_ondemand EQ 1 AND qryAlso_Bought.is_disabled
    NEQ 1 AND request.allowVOD eq 1><div
    class="on-demand-call-out"
    style="cursor:pointer;margin-top:-22px;margin-top:-25/**/px;margin-left:21px;background:
    url(../skins/graphics/btns/ondemand-overlay.gif) 0 0
    no-repeat;width:79px;height:22px;filter:alpha(opacity=80);-moz-opacity:.80;opacity:.80;">< /div></cfif></a>
    </div>
    <div class="productThumbTitle">
    <a href="#product_link#" class="picksLink"
    title="#linktitle#">#product_title#<cfif
    len(trim(extendedTitle))>
    (#extendedTitle#)</cfif></a>
    <!--- <cfif len(trim(qryAlso_Bought.hotmovies_id)) AND
    qryAlso_Bought.is_disabled NEQ 1 AND request.allowVOD eq
    1><div
    style="padding-top:5px;"><img
    src="../skins/graphics/btns/ondemand.gif" alt="Available
    On-Demand"
    border="0" /></div></cfif> --->
    </div>
    </div>
    <cfif prodCount MOD detailsColCount EQ
    0></div></cfif>
    <cfset prodCount = IncrementValue(prodCount)>
    <cfset alsobought_counter =
    IncrementValue(alsobought_counter)>
    </cfif>
    </cfoutput>
    <cfif (prodCount-1) MOD detailsColCount NEQ
    0></div></cfif>
    </div>
    Text

    After you run your query, look at the record count. Run all
    the if/else logic you have to to determine the number of columns
    you want. Don't worry about the number of rows, that will take care
    of itself.
    Once you have the number of columns figured out, output your
    data as simply as possible, no style tags, no links, just data. Use
    the modulus operator to decide when to start a new row.
    Once you've accomplished that, start adding the rest of your
    stuff.

Maybe you are looking for

  • Terminal window jumps on move

    If I have a terminal window open, am working in a different program, and I immediately move the terminal window, the terminal window will initially follow the pointer, and then it will jump back to the original position. It will then continue to move

  • ResultSet Class in XI

    Hi, I need to know in which jar file the ResultList class is available and how to get, I want to know all the methods in ResultList. I will add value to result list by using result.addValue, but how to remove single value. Thanks, RamuV

  • Authorization hierarchy variables in QD

    Hi! Is it possible in Query Designer to create a hierarchy  authorization variable (i.e. based on a profit center), which is <b>editable</b>, searchable (F4) and the default value is automatically included from the authorization profile? -OV-

  • Lync 2013 hang after sign-in

    Lync 2013 with latest CU hang after sign in. Description A problem caused this program to stop interacting with Windows. Faulting Application Path: C:\Program Files\Microsoft Office\Office15\lync.exe Problem signature Problem Event Name: AppHangB1 Ap

  • I created webdynpro view then i want to export to sap portals using SLD CON

    hi every body i created WebDynpro views in NetWeaver dev studio then i want to export to sap portals i have to use SLED CONFIGURATION what are all step required can post to me and aloes step to configure in visual administrator and JCo connections be