Query Logic

Hi All,
We need a report in following format for current fiscal year. Products go on FIFO basis.
I tried deriving the summary sale for for current year (Item wise) but what will be the starting point to pick GR -POs ?
I'm unable to devise logic for this.
Brand               Product                   Qty * Rate (Sale Value)                     Landed cost
Please help. I'm badly stuck.
Thanks
Malhaar

Hi,
I mean this,
Product              GRPO Date                     Qty                             LP
x                         01/mar/2011                   100                            50
X                         15/mar/2011                   25                              15
Product                      Invoice Date                 Qty sold                                       Rate                          Total                  
x                                 08/mar/2011                 80 (From First GRPO)                 100                            8000                 
x                                 18/mar/2011                 15 (From First GRPO)
x                                 25/mar/2011                 20(5 from First and rest from second GRPO)
like wise i want to have assessable value and LP against each product sold during current fiscal year.
In above invoices, the product is sold agains two GRPOs with two different LP
Thanks
Malhaar

Similar Messages

  • Assistance in writing Query / Query Logic.

    I have a peculiar requirement to fetch data.
    Table Structure ( Sample ... although real table has more fields)
    Order ( orderid varchar2(30), custid varchar2(30), status varchar2(1), createdon datetime )
    Sample Data:
    OrderID CustID AccID Status createdon
    123 111 Y 20-Jan-2012 01:29:22
    124 111 100 Y 22-Jan-2012 01:23:02
    125 111 100 N 23-Jan-2012 02:34:24
    126 111 100 N 28-Jan-2012 04:23:22
    127 111 100 N 29-Jan-2012 07:32:26
    123Cancel 111 100 N 31-Jan-2012 03:27:29
    I want to write 2 Queries.
    a. input is OrderId, Need to find out how many order's present with status = 'N' after that orderid provided.
    b. input is OrderId, Need to find out what is the previous order with status = 'Y'
    Note: There can be 100's of orders and Status would be Y on first come first serve basis... if one does not have status = 'Y' ie it is 'N' the following order's will never turn to final status = 'Y'.
    There are millions of records in the table.
    Your help for writing this query / logic would be highly appreciated. Am intending to do thru single query.
    Best Regards
    MH Doshi

    select count(*) from order
    where createdon >( select created from order where order_id = &order_id);
    and status = 'N';
    select * from (select a.*, rownum rn from (select order_id from order
    where status = 'Y'
    and createdon<(seelect createdon from order where order_id = &order_id)
    order by createdon)) where rn=1

  • Problem in Query Logic

    Hello,
    m having a query logic problem..
    i am getting 2 id's ... from which i want to select that particular id which has a maximum date.... this i wanted to search in another table ...
    any idea ,...??

    Aijaz Mallick wrote:
    Hello,
    m having a query logic problem..
    i am getting 2 id's ... from which i want to select that particular id which has a maximum date.... this i wanted to search in another table ...
    any idea ,...??Do you mean something like this?
    SQL> ed
    Wrote file afiedt.buf
      1  with table1 as (select 1 as id, to_date('03/04/2010','DD/MM/YYYY') as start_date from dual union all
      2                  select 2, to_date('05/04/2010','DD/MM/YYYY') from dual union all
      3                  select 3, to_date('04/04/2010','DD/MM/YYYY') from dual)
      4      ,table2 as (select 1 as id, 'Fred' as emp_name from dual union all
      5                  select 2, 'Bob' from dual union all
      6                  select 3, 'Jim' from dual)
      7  --
      8  -- END OF EXAMPLE DATA
      9  --
    10  select emp_name
    11  from   table2
    12  where  id = (select id
    13               from (select id, row_number() over (order by start_date desc) as rn
    14                     from   table1
    15                    )
    16               where rn = 1
    17*             )
    SQL> /
    EMP_
    Bob
    SQL>

  • SAP QUERY -logical data base ADA

    I have created a SAP Query with logical data base ADA,I have selected four tables in it.Do i need to link these tables if yes..where and how?The report is for fields in asset master data.
    .But i get below error when i try to genaret the output :
    Fields from parallel tables within a line
    Line: 01
    Field: Asset description
    (ANLT-TXT50, table ANLT)
    Field: License plate no. of vehichle
    (ANLZ-KFZKZ, table ANLZ)
    i get such similar five messages but they are warning..when i execute with warning however i get the fields with description but not with Value.Ex:i get asset description and not Asset number as required.

    You don't have to link them, they ar linked that is the power of a logical data base
    To get the text in your report you need the key fields
    Like
    (Lanque Key)
    company code
    asset number
    Asset sub number
    Go to info sets and look to the standard ones like /SAPQUERY/AM01

  • Infoset query logical database and transparent table

    Hi!
    We have an infoset with the data source logical database=PNP.
    We get some fields from the infotype 0768, P0768-PERNR, P0768-BEGDA, etc.
    Now we need add another table to make a join within infotype 0768 and table T5F99SE.
    For instance, in infotype 0768 I have one record with the fields PERNR and BEGDA and in the T5F99SE I have 3 records related to the unique record of infotype 0768, the fields of the table are PERNR, BEGDA, ACTDT and ADDAT .
    The fields values in the example can be:
    Infotype 0768: PERNR=00101800, BEGDA=20110401, DICOT=20, BACHE=1200
    Table T5F99SE:  record 1 PERNR=00101800, BEGDA=20110401, ACTDT=20110401, ADDAT=PB    E
                             record 2 PERNR=00101800, BEGDA=20110101, ACTDT=20110405, ADDAT=PC    E01
                             record 3 PERNR=00101800, BEGDA=20110401, ACTDT=20110409, ADDAT=PA    E
    The result we want get with infoset query is
    PERNR    BEGDA   DICOT  BACHE   ADDAT
    00101800 20110101 20        1200       PB    E
    00101800 20110101 20        1200       PC    E01
    00101800 20110101 20        1200       PA    E
    I would like to get the fields of the infotype and some fields of the table T5F99SE.
    Is possible do this action with ABAP modifying an infoset that already exists adding the fields of the transparent table?
    What should I do?
    Kind regards,
    Julian.

    My guess is that it would not be possible to include a transparent table into the LDBs PNP and PNPCE. Would need input from a technical expert there.
    However, instead of using the LDB, why don't you explore just using a direct table join? You may need to join PA0000, PA0001, PA0002 along with PA0768 and your other tables. An infoset can then be created on this table join.
    To go to the mode where you can create the table join, in your infoset transactions, choose 'Table join' instead of 'LDB'.

  • Add field in a query (logical data base)

    Hi,
    I want to add a field in a query .
    The data source of  its infoset is logical database .
    When i tried to drag and drop the field, the alv grid turned to alv list.
    Can you help me.
    thanks,
    Meriem.

    Hi Merim,
    As KAMESH mention,
    you can add  additional fields in your infoset and put the logic for that field in your infoset program and assign the same field in your existing group within infoset.
    once you assign the infoset and generate the infoset then your field will be reflected  in sap Query .
    you can add additional field in your output.
    Regards,
    Prasenjit Mishra

  • Date selection in query : logic needed!

    Hi,
    we have one calendar day depending on which the query result is displayed!
    Now the requirement is such that when user enters one date the query has to generate the result for the multiple date ranges including the one which he has entered.
    example: if user has entered 15/9/2007 then query should not only display the result of the date 15/9/2007 but also the results of  -5 to +2 ( means 10/9,11/9,12/9,13/9 and 14/9 plus 16/9 and 17/9 )
    simlarly other ranges like -8 to + 7 and so on
    How to define this in query?
    Thanks,
    Ravi

    Hello ,
    I need to make a graph conveying the information of the deliveries by comparing the goods issue date and promised date !
    report also requires how many deliveries were on time, how many were late and how many were early!
    for this requirement, i had thought of making a date selection field which is promised date and make furthur more date ranges selections by query it self so that late deliveries and early deliveries also covered in these date ranges.
    -5 to + 2 is that one range which is on time delivery range
    if the delivery is more eally than the -5 days then it is early delivery. even in ealry delivery i want to make how early it is.
    and suppose the delivery has crossed the promised date 2 days more then it is late delivery.
    all has to be acheived by single date selection and there after the logic which takes care of all the date ranges i had explained.
    i am looking for that logic which i am not finding
    Hope this is clear now
    Thanks,
    Ravi

  • JPA/Toplink changes the query logic

    Hi,
    Iam currently using JPA with Toplink implementation , i guess that toplink has its own way of optimizing the provided JPA query ; on another words , toplink sometimes changes the way you are using joins and exists statement to what looks optimized , but unfor. this caused me troubles tracking a query that should work on a certain way but its not cause the generated query by Toplink ( can be captured on the log ) does not represent the same logic , is this a known issue or do i have to write my JPA query on a way on which can be translated correctly by toplink , i know i should provide the query it self , but the model structure is too complex.
    Thanks in advance

    Hello,
    JPQL does not directly translate to SQL, so there might be some differences in what you may be expecting due to JPA requirements on the results that are returned. If there is a problem with specific queries, please let us know and file a bug if it is not behaving the way it should. A workaround would be to use a native SQL query directly.
    Best Regards,
    Chris

  • SQL Query Logic to to Calculate Shipment price

    Hi Experts,
    As i have created a thread already regarding this. You Can Refer my previous thread in [Previous Thread|http://forums.oracle.com/forums/thread.jspa?threadID=1027799&tstart=0]
    I will post my question again in this thread too,
    Table Records
    SHIPMENT_ID     SHIPMENT_PRICE     SHIPMENT_ADDT_PRICE     PRODUCT_ID     PRODUCT_QTY     VIRTUAL_COLUMN (Just for your Reference)     
    1000          6.95          2               11          4          1
    1000          6.95          2               11          4          2
    1000          3.95          1               13          2          3
    1000          3.95          1               12          2          4
    1001          12.95          2               11          4          5
    1001          12.95          1               13          2          6
    1001          12.95          2               11          4          7
    1001          12.95          1               12          2          8
    1002          20.95          1               12          2          9
    1002          20.95          2               11          4          10
    1002          20.95          2               11          4          11
    1002          20.95          1               13          2          12
    Repeated values in table with Maximum Value,
    SHIPMENT_ID     SHIP_PRICE     SHIPMENT_ADDT_PRICE     PRODUCT_QTY     PRODUCT_ID     VIRTUAL_COLUMN
    1000          6.95          2               4          11          1
    1000          6.95          2               4          11          2
    1001          12.95          2               4          11          5
    1001          12.95          2               4          11          7
    1002          20.95          2               4          11          10
    1002          20.95          2               4          11          11*
    In this Case, There are two rows same with maximum value for all three shipments,
    but need to take one row as maximum and to consider the other as like not maximum row to process the logic
    I have considered the Record with VIRTUAL_COLUMN value 1,5 and 10 as maximum value and others as not maximum values
    Expected Result (For Each Row) - Just listed for one shipment_id = 1000 here
    SHIPMENT_ID     SHIP_PRICE     CALCULATION          STEPS                                        VIRTUAL_COLUMN     
    1000          41.7          (1*6.95)+((4-1)*2)     Maximum ShipPrice + (PRODUCT_QTY-1)*SHIPMENT_ADDT_PRICE          1
    1000          8          (4*2)               PRODUCT_QTY*SHIPMENT_ADDT_PRICE                         2
    1000          2          (2*1)               PRODUCT_QTY*SHIPMENT_ADDT_PRICE                         3
    1000          2          (2*1)               PRODUCT_QTY*SHIPMENT_ADDT_PRICE                         4*Note: The virtual column in the provided data is just for reference and not exists in table
    Thanks,
    Dharan V

    Both query 1 and query 2 are wrong because both of them use the SHIPMENT_PRICE of the row and not the MAXIMUM SHIPMENT_PRICE for that product id as you requested in the original post.
    To get the MAXIMUM SHIPMENT_PRICE you should use my last query:
    SQL> with shipment_table as (
      2  select 1000 SHIPMENT_ID, 6.95 SHIPMENT_PRICE, 2 SHIPMENT_ADDT_PRICE,
      3         11 PRODUCT_ID, 4 PRODUCT_QTY, 1 VIRTUAL_COLUMN from dual union
      4  select 1000,6.95,2,11,4,2 from dual union
      5  select 1000,6.95,2,11,4,3 from dual union
      6  select 1000,6.95,2,11,4,4 from dual union
      7  select 1001,12.95,2,11,4,5 from dual union
      8  select 1001,12.95,2,11,4,6 from dual union
      9  select 1001,12.95,2,11,4,7 from dual union
    10  select 1001,12.95,2,11,4,8 from dual union
    11  select 1002,20.95,1,12,2,9 from dual union
    12  select 1002,20.95,1,12,2,10 from dual union
    13  select 1002,20.95,1,12,2,11 from dual union
    14  select 1002,20.95,1,12,2,12 from dual)
    15  SELECT shipment_id,
    16         shipment_price,
    17         shipment_addt_price,
    18         product_id,
    19         product_qty,
    20         CASE
    21            WHEN ROW_NUMBER() OVER (PARTITION BY shipment_id
    22                 ORDER BY shipment_addt_price DESC) = 1
    23            THEN
    24               (max(shipment_price) over (PARTITION BY shipment_id))
    25               + (product_qty - 1) * shipment_addt_price
    26            ELSE
    27               product_qty * shipment_addt_price
    28         END price
    29    FROM shipment_table;
    SHIPMENT_ID SHIPMENT_PRICE SHIPMENT_ADDT_PRICE PRODUCT_ID PRODUCT_QTY          PRICE
           1000           6,95                   2         11           4        12.9500
           1000           6,95                   2         11           4         8.0000
           1000           6,95                   2         11           4         8.0000
           1000           6,95                   2         11           4         8.0000
           1001          12,95                   2         11           4        18.9500
           1001          12,95                   2         11           4         8.0000
           1001          12,95                   2         11           4         8.0000
           1001          12,95                   2         11           4         8.0000
           1002          20,95                   1         12           2        21.9500
           1002          20,95                   1         12           2         2.0000
           1002          20,95                   1         12           2         2.0000
           1002          20,95                   1         12           2         2.0000
    12 rows selected.Look at line 24 of the query and you'll see the difference.
    On your data there is no difference because the same product as always the same shipment_price...
    Let's change a value in sample data:
    Query 1
    SQL> with shipment_table as (
      2  select 1000 SHIPMENT_ID, 6.95 SHIPMENT_PRICE, 2 SHIPMENT_ADDT_PRICE,
      3         11 PRODUCT_ID, 4 PRODUCT_QTY, 1 VIRTUAL_COLUMN from dual union
      4  select 1000,6.95,2,11,4,2 from dual union
      5  select 1000,100.95,2,11,4,3 from dual union
      6  select 1000,6.95,2,11,4,4 from dual union
      7  select 1001,12.95,2,11,4,5 from dual union
      8  select 1001,12.95,2,11,4,6 from dual union
      9  select 1001,12.95,2,11,4,7 from dual union
    10  select 1001,12.95,2,11,4,8 from dual union
    11  select 1002,20.95,1,12,2,9 from dual union
    12  select 1002,20.95,1,12,2,10 from dual union
    13  select 1002,20.95,1,12,2,11 from dual union
    14  select 1002,20.95,1,12,2,12 from dual)
    15  SELECT
    16     SHIPMENT_ID,
    17     SHIPMENT_PRICE,
    18     SHIPMENT_ADDT_PRICE,
    19     PRODUCT_ID,
    20     PRODUCT_QTY,
    21     CASE
    22        WHEN ROW_NUMBER() OVER (PARTITION BY SHIPMENT_ID
    23             ORDER BY SHIPMENT_ADDT_PRICE DESC) = 1
    24        THEN
    25           SHIPMENT_PRICE + (PRODUCT_QTY - 1) * SHIPMENT_ADDT_PRICE
    26        ELSE
    27           PRODUCT_QTY * SHIPMENT_ADDT_PRICE
    28     END NEW_SHIP_PRICE
    29  FROM shipment_table;
    SHIPMENT_ID SHIPMENT_PRICE SHIPMENT_ADDT_PRICE PRODUCT_ID PRODUCT_QTY NEW_SHIP_PRICE
           1000           6,95                   2         11           4          12,95
           1000           6,95                   2         11           4              8
           1000           6,95                   2         11           4              8
           1000         100,95                   2         11           4              8
           1001          12,95                   2         11           4          18,95
           1001          12,95                   2         11           4              8
           1001          12,95                   2         11           4              8
           1001          12,95                   2         11           4              8
           1002          20,95                   1         12           2          21,95
           1002          20,95                   1         12           2              2
           1002          20,95                   1         12           2              2
           1002          20,95                   1         12           2              2
    12 rows selected.My query:
    SQL> with shipment_table as (
      2  select 1000 SHIPMENT_ID, 6.95 SHIPMENT_PRICE, 2 SHIPMENT_ADDT_PRICE,
      3         11 PRODUCT_ID, 4 PRODUCT_QTY, 1 VIRTUAL_COLUMN from dual union
      4  select 1000,6.95,2,11,4,2 from dual union
      5  select 1000,100.95,2,11,4,3 from dual union
      6  select 1000,6.95,2,11,4,4 from dual union
      7  select 1001,12.95,2,11,4,5 from dual union
      8  select 1001,12.95,2,11,4,6 from dual union
      9  select 1001,12.95,2,11,4,7 from dual union
    10  select 1001,12.95,2,11,4,8 from dual union
    11  select 1002,20.95,1,12,2,9 from dual union
    12  select 1002,20.95,1,12,2,10 from dual union
    13  select 1002,20.95,1,12,2,11 from dual union
    14  select 1002,20.95,1,12,2,12 from dual)
    15  SELECT shipment_id,
    16         shipment_price,
    17         shipment_addt_price,
    18         product_id,
    19         product_qty,
    20         CASE
    21            WHEN ROW_NUMBER() OVER (PARTITION BY shipment_id
    22                 ORDER BY shipment_addt_price DESC) = 1
    23            THEN
    24               (max(shipment_price) over (PARTITION BY shipment_id))
    25               + (product_qty - 1) * shipment_addt_price
    26            ELSE
    27               product_qty * shipment_addt_price
    28         END price
    29    FROM shipment_table;
    SHIPMENT_ID SHIPMENT_PRICE SHIPMENT_ADDT_PRICE PRODUCT_ID PRODUCT_QTY          PRICE
           1000           6,95                   2         11           4       106.9500
           1000           6,95                   2         11           4         8.0000
           1000           6,95                   2         11           4         8.0000
           1000         100,95                   2         11           4         8.0000
           1001          12,95                   2         11           4        18.9500
           1001          12,95                   2         11           4         8.0000
           1001          12,95                   2         11           4         8.0000
           1001          12,95                   2         11           4         8.0000
           1002          20,95                   1         12           2        21.9500
           1002          20,95                   1         12           2         2.0000
           1002          20,95                   1         12           2         2.0000
           1002          20,95                   1         12           2         2.0000
    12 rows selected.Max
    http://oracleitalia.wordpress.com
    Edited by: Massimo Ruocchio on Feb 12, 2010 3:10 PM
    Added examples

  • Where clause query logic

    Dear friends,
    can anyone explain how this query works. It display the employees with nth highest salary from emp table.
    select empno,ename from emp e1 where n>=(select count(*) from emp e2 where e1.sal=<e2.sal)

    Hi,
    I don't understand your qury logic, did you want the employee into the N highest salary ?
    So, try this :
    select empno, ename, sal
    from (select empno, ename, sal, dense_rank() over(order by sal desc) dr
            from    emp) e1
    where e1.dr<=&n;[pre]
    Nicolas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Need help in correlated sub query logic

    Hi ,
    I have one procedure with cursor. I have given small part of the cursor as shown below .
    SELECT
      A.DAY_DATE,
      A.COUNTRY_CODE,
      A.INST_CODE,
      a.bra_code,
      a.cus_num,
      a.cur_code,
      a.led_code,
      a.sub_acct_code,
      (tra_amt * SPOT_RATE) pre_day_crnt_bal,
      t.mat_date,
      t.NEW_INT_RATE int_rate,
      t.DEB_CRE_IND int_chg_pai_ind,
      a.ACCT_TYPE,
      (SELECT COUNT (
      DISTINCT TO_CHAR (day_date, 'mm')
      FROM PIO_TIMES
      WHERE day_date BETWEEN a.day_date
      AND NVL ( T.MAT_DATE,A.DAY_DATE) 
      AND TO_CHAR (day_date, 'dd') = '31') Test
    Here how can I build the logic for inside select statement.
    I tried to build the separate stream for the inside select statement but I am confusing how to handle the count in the inside the query.
    Please help me how to build the logic for the inside query statement .
    Thanks & Regards,
    Ramana.

    Hi Balakrishna,
    Thanks for your support
    I have applied but I am not getting the column in the output columns from the custom sql function.
    As per the procedure we are using the all conditions like between and month or date conditions  to find the count of distinct months.
    If we use partial conditional in the custom SQL  and partial conditionals in the lookup condition clause is it give the same result?
    How can we get the field of custom sql in the output field.
    Thanks & Regards,
    Ramana.

  • Need Query Logic Help.

    Hello, Experts.
    I am Design a Query, in that i need to do year over year comparison.
    i.e. in the report we have to show data from 2007 - 2012,
    Comparing 2007 fcst data with 2006 FCST data, 2008 fcst data with 2007 fcst like that untill 2012 data with 2011 data.
    in the Col. i have Cal.Year ( range from 2006 -2012 )
    in the Rows i have key fig Struct and i have product Family on top of the key fig struct.
    Product Family Keyfig/calyear      2007    2008  2009  2010  2011  2012
    prod A                             FCST            10        11     11      10     14    15
                          var year over year                 1        0       -1      -4     1
    Is there a way to achieve this, Please i need some suggestions and Logic help.
    sharp deep

    I Did this in one way that is...  Creating 7 FCST key fig  restricting it with Cal year -1 ,calyear  ,  Calyear +1... respectively.....  and then 6 Cal key fig  Sub
    in the Col.  i have this  Keyfig Struct.
    Res Keyfig 2006 ( Key fig FCST and Resctricted with 2006 )
    Res Keyfig 2007 ( Key fig FCST and Resctricted with 2007 )
    Res Keyfig 2008 ( Key fig FCST and Resctricted with 2008 )
    Res Keyfig 2009 ( Key fig FCST and Resctricted with 2009 )
    Res Keyfig 2010 ( Key fig FCST and Resctricted with 2010 )
    Res Keyfig 2011 ( Key fig FCST and Resctricted with 2011 )
    Res Keyfig 2012 ( Key fig FCST and Resctricted with 2012 )
    Var 2007 Cal key fig  ( Res Keyfig 2006 -Res Keyfig 2007)
    Var 2008 Cal key fig  ( Res Keyfig 2007 -Res Keyfig 2008)
    Var 2009 Cal key fig  ( Res Keyfig 2008 -Res Keyfig 2009)
    Var 2010 Cal key fig  ( Res Keyfig 2009 -Res Keyfig 2010)
    Var 2011 Cal key fig  ( Res Keyfig 2010 -Res Keyfig 2011)
    Var 2012 Cal key fig  ( Res Keyfig 2011 -Res Keyfig 2012)
    in the Row i have Product Family.
    if i add any thing like  Stat Fcst again i have to Create this many Fields ....  i am looking for some easy way/other way to achive this
    Thanks
    sharp deep

  • Query , logical DB or report about plan maintenance and functional location

    Hi,
    I've to do a report about a list of plan maintenance. I've to show the functional location affected by the plans but in the table MPOS the field TPLNR doesn't exist.
    But I have maintenance plans that affects to functional location only. I've not found any useful logical database or report to show this information.
    Could anybody help to me?
    Thanks
    Best Regards

    Dear
    The SAP is provded the option please check once again
    Table MPOS- Field ILOAN 
    First take the ILOAN from ILOA table by object reference is 2 (Field: OWNER) in output.
    Then put the Loc/acct assignment value at input of the MPOS table which is u received from ILOA table

  • Insert Query - Logic?

    Table Name : WLCustAct_Emp
    Structure and data
    CustLifeNo WLActCatId WLDayId WeekNo WLEmpTypeId
    330374 FRI 1
    330374 FRI 1 C
    330374 M FRI 1
    330374 M FRI 1
    330374 M FRI 1 C
    330374 FRI 1
    330374 FRI 1
    330374 FRI 1 C
    330374 FRI 1
    330374 D MON 1
    330374 M MON 1
    330374 M MON 1
    330374 D MON 1 C
    330374 MON 1
    330374 MON 1 C
    330374 MON 1
    330374 M MON 1 C
    330374 D MON 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 M WED 1
    330374 O WED 1
    330374 O WED 1 C
    330374 O WED 1
    330374 WED 1
    330374 WED 1 C
    330374 WED 1
    330374 M WED 1
    330374 M WED 1 C
    Table WLCust_Denormalized :
    CustLifeNo,
    WeekNo,
    MON_Act_M,
    MON_Act_O
    MON_Act_D
    MON_Emp_C
    MON_Emp_F
    MON_Emp_P
    TUE_Act_M
    TUE_Act_O
    TUE_Act_D
    TUE_Emp_C
    TUE_Emp_F
    TUE_Emp_P
    WED_Act_M
    WED_Act_O
    WED_Act_D
    WED_Emp_C
    WED_Emp_F
    WED_Emp_P
    THU_Act_M
    THU_Act_O
    THU_Act_D
    THU_Emp_C
    THU_Emp_F
    THU_Emp_P
    FRI_Act_M
    FRI_Act_O
    FRI_Act_D
    FRI_Emp_C
    FRI_Emp_F
    FRI_Emp_P
    SAT_Act_M
    SAT_Act_O
    SAT_Act_D
    SAT_Emp_C
    SAT_Emp_F
    SAT_Emp_P
    SUN_Act_M
    SUN_Act_O
    SUN_Act_D
    SUN_Emp_C
    SUN_Emp_F
    SUN_Emp_P
    I want to insert recrods from In tblWLCust_Denormalized table from WLCustAct_Emp table
    More in detail M,O,D Value belogs to Act, And C,F,P value Belongs to Emp
    After Insert query Table WLCust_Denormalized will have only one record..
    CustLifeNo -- 330374
    WeekNo -- 1
    MON_Act_M -- M
    MON_Act_O -- O
    MON_Act_D -- D
    MON_Emp_C -- C
    MON_Emp_F -- NULL
    MON_Emp_P -- NULL
    and so...on...
    Any help really appriciate...
    Thx
    AD

    You Can do like this ....
    insert into WLCust_Denormalized
    select distinct CustLifeNo,WeekNo,decode(count(distinct MON_Act_M),1,'M'),
    decode(count(distinct MON_Act_O),1,'O'),................... from
    (select CustLifeNo,WeekNo,decode(WLActCatId,'M','M') MON_Act_M,
    decode(WLActCatId,'O','O') MON_Act_O, ............. from WLCustAct_Emp)
    Regards,
    Santosh

  • Query logic board prob - errors on installing Tiger

    Hello
    I'm trying to fix a friends G4 iBook 1.2GHz and have apparently made it worse.
    It was running on 10.3.9 and warning of the HD being full so I suggested installing more RAM and updating to 10.4.8
    I put in 512 mb of RAM and tried installing Tiger (from 10.4.6 Apple install disk - a generic one - not a specific to iBook version) and whatever I try it starts the instal and then stops "there were errors installing, please restart and try again"
    I pulled the extra RAM out thinking that may be the cause but got same error. I tried starting the iBook in target disk mode and installing Tiger from my old G4 PowerMac. Also tried zero'ing all data on the iBook. Everything I do gets the same message. I think the message is exactly as I have typed above - there's no error code or specific reason for failure to install. Needless to say, it wont boot from the failed instal version - it just gets a black screen.
    As I understand it was generally working before I did all this. It had been dropped a year ago and was reparied by Apple - new case and hinges. The battery now doesn't fit very well but it does always power up fine so I'm not assuming that is to blame for anything.
    I think that gives all the necessary info. My guess is there may be a fault on the logic board. Another guess could be to do with the instal disk but it has worked fine on my G4 Powermac. Also, I have not run the Apple Hardware tester. I've had one in the past but cannot currently find it.
    If you have any suggestions, I'd be very grateful to hear them. Many thanks

    Hi RichT353
    I my opinion you fell at the first hurdle. An overfull hard drive can cause all sorts of erratic behavior.
    Instead of adding RAM, the remedy would have been a larger Hard disk.
    Nevermind; you must try to restart it in a functioning Operating System, - if that's panther, that is OK, and then make some space on the disk, by dealing with excesive music, file, photos, videos, and other such personal documents.
    Boot from the Installer CD, holding down the C key and then after selecting the language, go up to the top menu bar, to run Disk Utility and selecting the Hard disk, choose
    Repair Disk.
    Then Repair Permissions.
    Exit disk utility, cancel the installation and restart normally.
    Once you have things back on an even keel, then think about upgrading the OS to Tiger.
    Of course adding the extra RAM will not hurt.
    good luck
    regards roam

Maybe you are looking for

  • USB devices no longer connected

    Since installing Snow Leopard I have had problems with my Epson R2880 printer. I downloaded a later driver and this worked for a few days but now it will no longer print from any application. My TomTom has also stopped working on USB. The USB ports s

  • How to access my security question ?

    how to access my security question ?

  • Idoc Segment adding

    hi,    i have extended a idoc with few segements and i am trying to add a few segements to the idoc in the BADI how to specify the hirarchy. cheers

  • Displaying "Category Name" in Module Listings ???

    I still don't know why this hasn't been done yet. I requested for this functionality number of times and it's been like 3 years but it seems that all my effort have been ignored. Well you can manually type category names and list items like this Cate

  • Do I have a Virus? Only character on my desktop is AAAAAAAAAAAAA

    I think my powerbook may have a virus i can run some programs no problem, such as firefox right now... but am unable to open files the menu at the top of the desktop screen, doesnt display the normal file, edit help etc.... it has AAAAAAAAA, AAAAA, A