Need Help in Query Design!!!!

Hello Guys,
We are developing a BI 7 report. the requirement is such that the customer during query execution is providing the number of days. With this input in consideration, we need to bring in data which falls in the range (current date - number of days). Would be great if you can share your ideas on it.

Hi,
You can use variables where it will prompt you to enter the calendar year and based on that the query will be displayed...
Check out the link below:
http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/frameset.htm
Regards,
Kishore

Similar Messages

  • 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

  • Need help with Query

    Hi,
    Good day everyone! I need help writing a query. I have this table with the following data in them...
    ACCT_CODE  FSYR      YTD_AMT
    A123            11          100  
    A456            11          200
    A123            10          50
    A456            10          100I want the output to look like this:
    ACCT_CODE     CURRENT_YEAR(11)       PRIOR_YEAR(10)
    A123               100                              50
    A456               200                              100The user will input the fiscal year and based on that input, I want to get the prior year value as well.
    Thank you for all your help!!
    Edited by: user5737516 on Jun 29, 2011 6:48 AM
    Edited by: user5737516 on Jun 29, 2011 6:50 AM

    user5737516 wrote:
    Hi,
    Good day everyone! I need help writing a query. I have this table with the following data in them...
    ACCT_CODE FSYR YTD_AMT
    A123 11 100
    A456 11 200
    A123 10 50
    A456 10 100
    I want the output to look like this:
    ACCT_CODE CURRENT_YEAR PRIOR_YEAR
    A123 100 50
    A456 200 100
    The user will input the fiscal year and based on that input, I want to get the prior year value as well.
    Thank you for all your help!!what is prior year?

  • 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 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.

  • Need help on query simplification...!!

    Hi All,
    I need help on below query simplification using idempotence rules.
    SELECT ENO FROM AGS WHERE RESP = "Analyst" AND NOT (PNO = "P2" OR DUR = 12) AND PNO != "P2" AND DUR = 12;
    Thanks.

    928351 wrote:
    Hi All,
    I need help on below query simplification using idempotence rules.
    SELECT ENO FROM AGS WHERE RESP = "Analyst" AND NOT (PNO = "P2" OR DUR = 12) AND PNO != "P2" AND DUR = 12;
    Thanks.How do we know what the correct result set is?
    Handle:     928351
    Status Level:     Newbie
    Registered:     Apr 17, 2012
    Total Posts:     4
    Total Questions:     3 (3 unresolved)
    ZERO for three! STRIKE 3 you are out!

  • 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 with query joining several tables into a single return line

    what i have:
    tableA:
    puid, task
    id0, task0
    id1, task1
    id2, task2
    tableB:
    puid, seq, state
    id0, 0, foo
    id0, 1, bar
    id0, 2, me
    id1, 0, foo
    id2, 0, foo
    id2, 1, bar
    tableC:
    puid, seq, date
    id0, 0, 12/21
    id0, 1, 12/22
    id0, 2, 12/22
    id1, 0, 12/23
    id2, 0, 12/22
    id2, 1, 12/23
    what i'd like to return:
    id0, task0, 12/21, 12/22, 12/22
    id1, task1, 12/23, N/A, N/A
    id2, task2, 12/22, 12/23, N/A
    N/A doesn't mean return the string "N/A"... it just means there was no value, so we don't need anything in this column (null?)
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line...
    id0, task0, 12/21
    id0, task0, 12/22
    id0, task0, 12/23
    id1, task1, 12/23
    is this possible fairly easily?
    Edited by: user9979830 on Mar 29, 2011 10:53 AM
    Edited by: user9979830 on Mar 29, 2011 10:58 AM

    Hi,
    Welcome to the forum!
    user9979830 wrote:
    what i have:...Thanks for posting that so clearly!
    Whenever you have a question, it's even better if you post CREATE TABLE and INSERT statements for your sample data, like this:
    CREATE TABLE     tablea
    (       puid     VARCHAR2 (5)
    ,     task     VARCHAR2 (5)
    INSERT INTO tablea (puid, task) VALUES ('id0',  'task0');
    INSERT INTO tablea (puid, task) VALUES ('id1',  'task1');
    INSERT INTO tablea (puid, task) VALUES ('id2',  'task2');
    CREATE TABLE     tablec
    (       puid     VARCHAR2 (5)
    ,     seq     NUMBER (3)
    ,     dt     DATE          -- DATE is not a good column name
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  0,  DATE '2010-12-21');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  1,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  2,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id1',  0,  DATE '2010-12-23');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  0,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  1,  DATE '2010-12-23');This way, people can re-create the problem and test their ideas.
    It doesn't look like tableb plays any role in this problem, so I didn't post it.
    Explain how you get the results from that data. For example, why do you want this row in the results:
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/21/2010 12/22/2010 12/22/2010rather than, say
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/22/2010 12/21/2010 12/22/2010? Does 12/21 have to go in the first column because it is the earliest date, or is it because 12/21 is related to the lowest seq value? Or do you even care about the order, just as long as all 3 dates are shown?
    Always say what version of Oracle you're uisng. The query below will work in Oracle 9 (and up), but starting in Oracle 11, the SELECT ... PIVOT feature could help you.
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line... Condensing the output, so that there's only one line for each puid, sounds like a job for "GROUP BY puid":
    WITH     got_r_num     AS
         SELECT     puid
         ,     dt
         ,     ROW_NUMBER () OVER ( PARTITION BY  puid
                                   ORDER BY          seq          -- and/or dt
                           )         AS r_num
         FROM    tablec
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT       a.puid
    ,       a.task
    ,       MIN (CASE WHEN r.r_num = 1 THEN r.dt END)     AS dt1
    ,       MIN (CASE WHEN r.r_num = 2 THEN r.dt END)     AS dt2
    ,       MIN (CASE WHEN r.r_num = 3 THEN r.dt END)     AS dt3
    ,       MIN (CASE WHEN r.r_num = 4 THEN r.dt END)     AS dt4
    FROM       tablea    a
    JOIN       got_r_num r  ON   a.puid  = r.puid
    GROUP BY  a.puid
    ,            a.task
    ORDER BY  a.puid
    ;I'm guessing that you want the dates arranged by seq; that is, for each puid, the date related to the lowest seq comes first, regardless of whther that date is the earliest date for that puid or not. If that's not what you need, then change the analytic ORDER BY clause.
    This does not assume that the seq values are always consecutive integers (0, 1, 2, ...) for each puid. You can skip, or even duplicate values. However, if the values are always consecutive integers, starting from 0, then you could simplify this. You won't need a sub-query at all; just use seq instead of r_num in the main query.
    Here's the output I got from the query above:
    PUID  TASK  DT1        DT2        DT3        DT4
    id0   task0 12/21/2010 12/22/2010 12/22/2010
    id1   task1 12/23/2010
    id2   task2 12/22/2010 12/23/2010As posted, the query will display the first 4 dts for each puid.
    If there are fewer than 4 dts for a puid, the query will still work. It will leave some columns NULL at the end.
    If there are more than 4 dts for a puid, the query will still work. It will display the first 4, and ignore the others.
    There's nothing special about the number 4; you could make it 3, or 5, or 35, but whatever number you choose, you have to hard-code that many columns into the query, and always get that many columns of output.
    For various ways to deal with a variable number of pivoted coolumns, see the following thread:
    PL/SQL
    This question actually doesn't have anything to do with SQL*Plus; it's strictly a SQL question, and SQL questions are best posted on the "SQL and PL/SQL" forum:
    PL/SQL
    If you're not sure whether a question is more of a SQL question or a SQL*Plus question, then post it on the SQL forum. Many more people pay attention to that forum than to this one.

  • Application Help for Query Designer for Netweaver 2004S

    Does anyone know how to install the Help Files for the Business Explorer Tool for Netweaver 2004S?  When I click on the Help>>Applicaton Help from any of these tools, it states it can't find the files.  I have it setup and working within ABAP.
    Thanks,
    Jeff Cook

    The help dvd that came with upgrade explains how to setup for the ABAP side, not the Query Designer.  Do you know the parameter settings?  Does Query Designer help use the sapdoccd.ini file?
    Thanks ,
    Jeff

  • Need Help for Page Design Technique: Level 0 Record and Level 1 Record

    Folks,
    Hello. I am developing HR system for a client. I design a page for "Position Information" as follows:
    Level 0 record fields:
    Position Number: 01
    Status: Open
    Because many people are in this position, level 1 record is a scroll area containing many rows belong to this Position Number as follows:
    Level 1 record fields:
    Profile ID: 001 effective date: xx/xx/xxxx
    Profile ID: 002 effective date: xx/xx/xxxx
    After save the page into Database, the data in Level 1 record table doesn't match the data in Level 0 record table.
    No way to identify the rows of data in Level 1 record table belong to a specific row of data in Level 0 record table.
    I need help to design the Database, that is 2 tables: many rows in second table belong to one row in first table.
    Can any folks give some idea to design such a Database so that save the Page correctly ?

    Table 2 should have all the key fields from Table 1, followed by atleast one more key of its own.
    Subhash

  • Need help wrt query

    Hi ,
    I have table A with below data :
    Name Sal
    Ram

    That's because it's over here:
    Need help wrt query

  • Need help regarding query

    dear all,
    i am working with JDBC and Access database. I have a table name FilingTable and it has 6 column: title, mdate, tdate, place, content and person. the UI has a jdbtable where it shows all the data from the database. there are six textfield where i can give value seach for perticular row consisting this value. the quirement is : I may give a parameter, two parameter and may be six parameter the search will show the rows containing those value or closely similar to those value. I need help from you.
    zakir

    Hello,
    Try SQL with the LIKE condition to perform your search and % as wildcards.
    LIKE will however not find similar matches but only exact matches.
    Hope this helps
    Niklas

  • Need help in voip design

    hi,
    our customer having nearly 30 branches. 20 are connected to central office via leased lines.
    And 10 branches are connected by internet.
    Now customer willing to use voip on all these branches.
    That is From central office to leased line offices and internet offices vice versa..
    And there are analog phones with PBXs.
    present along with them soft and hard IP phones are required with redundancy.
    so anybody can help me in designing this voip setup? (designing means what are the required equipments and protocols for this setup)
    Regards
    skrao
    Regards
    skrao

    Skrao,
    Several ways to go here I don't really recommend the VOIP over the internet but your going to have to do a user count and peak call utilzation survey for each site.
    Your probably going to go with one of the ASxxxx models for the central site and 2800 or 1800 for the remote sites. As for the VPN offices you might try CME Call Manager Express for them or keep there existing PBX's kinda depends on what there Goals are.
    I can't give you specific parts because there is such a huge combination of different ways to go but your gist is you'll probably have a couple of Access-Servers to handle your primary site PSTN connections and then put something that can handle SRST Survivable Remote Site Telephony at each branch office. For your VPN sites your going to want to use Call Manager Express.
    Patrick

  • Need Help Please  - Data Design

    Hi,
    I have flow from Data Source to DSO and to cube.
    The cube has 3 master data  fields. 0employee, 0orgunit and 0gender. ( 0employee is having attributes 0orgunit and 0person ) 
    0person is time dependent and 0gender is attribute of 0person.
    I cant use any of 3 fields in DSO or datasource and until DSO nothing should be changed.
    Now 0employee is mapped with a field from DSO. I have to get data for 0orgunit and 0gender.
    Clients says to use infosource between DSO and Cube to read meta data for 0person and then use 0orgunit and 0gender as navigational attributes in cube.
    I dont understand what they mean by this. At the end we need data for 0orgunit and 0gender in cube.
    Also client say " 0PERSON is a time depended and you've to put the due date. For Data from actual year it would be current day, and for the "historical" ones use field_x an auxillary field in the InfoSource might help there " What do to for this?
    Please help
    Regards
    Zabi
    Edited by: Syed786 on Sep 12, 2011 11:52 AM
    Edited by: Syed786 on Sep 12, 2011 12:14 PM
    Edited by: Syed786 on Sep 12, 2011 6:08 PM

    Hi Frank,
    I'm creating some SEM Management Cockpit, the problem I faced is not the BEx Query itself, but the pie chart design and display. I have processed my data in advance, so there a only 5 values in my query at a time, and these area values are not constant values. If I don't mark a selection criteria, it will display a full pie in Management Cockpit.
    And if I browse the query in IE directory, I can get a desired pie chart by "Swap Axes", so I think maybe there is a same choose in Management Cockpit.
    Thank you and Best Regards,
    Rocket

  • Need help with class design

    I want to design and use one or more classes for a particular project I am working on.
    I need some advice hopefully from someone who has experience in this area. Basically,
    for this particular problem I have two database tables. I want the first class to
    represent the first database table and the second class to represent the second
    database table. An object of the first class will be created first, and then if certain
    criteria are met then an object of the second class will be created.
    Question:
    Should I use classical inheritance and let the first class inherit from the second class?
    Or should I use the containment delegation model and embed an object of the second
    class in the first class?
    ----Tables------
    For example, my first table ET_UserData looks something like this:
    ET_UserData
    (PK)UserName
    Password
    FirstName
    LastName
    My second table ET_DetailedUserData looks like this
    ET_DetailedUserData
    (FK)UserName
    WorkAddress
    WorkPhoneNumber
    CityWhereEmployed
    SocialSecurityNumber
    City
    State
    StreetAdress
    PrimaryTelephoneNumber
    AlternatePhoneNumber
    HasRegistered
    RegistrationDate
    RegistrationTime
    CreditCardNumber
    NameOfPrimaryContact
    DateOfBirth
    Weight
    EyeColor
    Height
    Member
    Here is are some pseudo classes for the two classes.
    Class UserData
    string UserName
    string FirstName
    string LastName
    Class DetailedUserData /* For a classical approach, sub class off of class UserData */
    /* UserData ThisUser --> Containment delegation model */
    string (FK)UserName
    string WorkAddress
    string WorkPhoneNumber
    string CityWhereEmployed
    string SocialSecurityNumber
    string City
    string State
    string StreetAdress
    Int PrimaryTelephoneNumber
    Int AlternatePhoneNumber
    Bool HasRegistered
    Int RegistrationDate
    Int RegistrationTime
    Int CreditCardNumber
    String NameOfPrimaryContact
    Int DateOfBirth
    Int Weight
    Int EyeColor
    Int Height
    bool Member
    }

    Thank you for your help. If you can continue to help me I would appreciate it.
    I and another developer did the database design. Pretty solid design. Plus we have all of the requirements
    which are very good too.
    Originally I wanted just one table to contain all of the data associated with a user. Instead of ET_UserData and ET_Detailed user data I wanted just one table. But I decided to break this table up into the two tables for the following reason.
    1.) This is a web application where each user logs into a web form. At a minimum, in order to use the website the session associated with each user needs the UserName, Password, First and last name.
    This is the data in the first table.
    If they choose to do more specialized functions on this website, then they will need all of the information (Attributes) that are located in the second table. In general 40% of the time all users will need information located in the second table.
    My reasoning for breaking the table into two seperate tables is that I wanted to minimize the amount of data involved in a result set, created from the sql query. The math tells me that 60% of the time most of the data in the result set will not be used.
    2.) If I create one class to represent all of the data/attributes in both tables, then my reasoning is that their will be alot of overhead in the single class because 60% of the time, a majority of the attributes are not needed and used.
    I would deeply appreciate your help with this. You seem to have great insight and advice. Please help me as I increase the duke dollars Sir.

Maybe you are looking for