How to satisfy GROUP BY

first view  :B2BFEB11_TEST
second view : B2BFEB11_TEST2
can any one tell me how do i make these two views into one. in B2BFEB11_TEST i can take send_date as timestamp but should be included in group by.
My condition is i should use send_date as timestamp but i should not use them in group by cluase.
My group by CLAUSE should consists of only below mentioned fields.
            A.STO_NO,
            A.CUR_CODE,
            A.RECEIPT_NO,
            A.CASH_NO,
            A.SALES_DATE
can you help me how to implement this timestamp in my view .... because i need to use this timestamp column  in another table.CREATE OR REPLACE FORCE VIEW B2BFEB11_TEST
SEND_DATE,
BU_CODE,
BU_TYPE,
CUST_NO,
CUR_CODE,
SALES_DATE,
RECEIPT_NO,
TILL_NO,
CARD_NO,
INVOICE_TOTAL,
AMOUNT_OF_GOODS,
AMOUNT_NON_GOODS,
AMOUNT_ADVANCE_PAY,
AMOUNT_DISCOUNTS,
ON_HOLD_FLAG,
IDRS_NAME,
RUN_DATE,
FIX_DATE,
RUN_DATE_PREV
AS
SELECT DISTINCT
NULL AS TIME_STAMP,
CAST (A.STO_NO AS VARCHAR2 (5 CHAR)) AS BU_CODE,
CAST ('STO' AS VARCHAR2 (3 CHAR)) AS BU_TYPE,
CAST (NULL AS VARCHAR2 (7 BYTE)) AS CUST_NO,
CAST (A.CUR_CODE AS VARCHAR2 (3 BYTE)) AS CUR_CODE,
TO_DATE (A.SALES_DATE, 'YYMMDD'),
CAST (A.RECEIPT_NO AS VARCHAR2 (10 BYTE)),
CAST (A.CASH_NO AS VARCHAR2 (5 BYTE)) AS TILL_NO,
CAST (NULL AS VARCHAR2 (2 BYTE)) AS CARD_NO,
CASE
WHEN A.cur_code IN ('JPY', 'HUF')
THEN
CAST (SUM (sold_amount) AS NUMBER (11, 2)) * 1
ELSE
CAST (SUM (sold_amount) AS NUMBER (11, 2)) / 100
END
AS invoice_total,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_ADVANCE_PAY,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_OF_GOODS,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_NON_GOODS,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_DISCOUNTS,
'N' AS ON_HOLD_FLAG,
'F6581001' AS IDRS_NAME,
NULL AS RUN_DATE,
NULL AS FIX_DATE,
NULL AS RUN_DATE_PREV
FROM I_0470002_LOG_T A
WHERE A.SALES_DATE IN
('121115',
'121116',
'121117',
'121118',
'121119',
'121120',
'130130',
'130131')
AND A.SOLD_AMOUNT != 0
GROUP BY A.STO_NO,
A.CUR_CODE,
A.RECEIPT_NO,
A.CASH_NO,
A.SALES_DATE
CREATE OR REPLACE FORCE VIEW B2BFEB11_TEST2
SEND_DATE,
BU_CODE,
BU_TYPE,
CUST_NO,
CUR_CODE,
SALES_DATE,
RECEIPT_NO,
TILL_NO,
CARD_NO,
INVOICE_TOTAL,
AMOUNT_OF_GOODS,
AMOUNT_NON_GOODS,
AMOUNT_ADVANCE_PAY,
AMOUNT_DISCOUNTS,
ON_HOLD_FLAG,
IDRS_NAME,
RUN_DATE,
FIX_DATE,
RUN_DATE_PREV)
AS
SELECT DISTINCT
timestamp AS TIME_STAMP, ---------------------------------------------------------i want timestamp as one column
CAST (null AS VARCHAR2 (5 CHAR)) AS BU_CODE,
CAST ('STO' AS VARCHAR2 (3 CHAR)) AS BU_TYPE,
CAST (NULL AS VARCHAR2 (7 BYTE)) AS CUST_NO,
CAST (null AS VARCHAR2 (3 BYTE)) AS CUR_CODE,
null as sales_date,
CAST (null AS VARCHAR2 (10 BYTE)),
CAST (null AS VARCHAR2 (5 BYTE)) AS TILL_NO,
CAST (NULL AS VARCHAR2 (2 BYTE)) AS CARD_NO,
null as invoice_total,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_ADVANCE_PAY,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_OF_GOODS,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_NON_GOODS,
CAST (NULL AS NUMBER (11, 2)) AS AMOUNT_DISCOUNTS,
'N' AS ON_HOLD_FLAG,
'F6581001' AS IDRS_NAME,
SYSDATE AS RUN_DATE,
SYSDATE AS FIX_DATE,
SYSDATE AS RUN_DATE_PREV
FROM I_0470002_LOG_T A
Edited by: 891933 on 12-Feb-2013 22:18
Edited by: 891933 on 12-Feb-2013 22:43
Edited by: 891933 on 12-Feb-2013 22:52

I think that the min(time_stamp) will be sufficient:
SELECT MIN(time_stamp)               AS TIME_STAMP,
  CAST(A.STO_NO AS   VARCHAR2(5 CHAR)) AS BU_CODE,
  CAST('STO' AS      VARCHAR2(3 CHAR)) AS BU_TYPE,
  CAST(NULL AS       VARCHAR2(7 BYTE)) AS CUST_NO,
  CAST(A.CUR_CODE AS VARCHAR2(3 BYTE)) AS CUR_CODE,
  TO_DATE(A.SALES_DATE, 'YYMMDD'),
  CAST(A.RECEIPT_NO AS VARCHAR2(10 BYTE)),
  CAST(A.CASH_NO AS    VARCHAR2(5 BYTE)) AS TILL_NO,
  CAST(NULL AS         VARCHAR2(2 BYTE)) AS CARD_NO,
  CASE
    WHEN A.cur_code IN('JPY', 'HUF')
    THEN CAST(SUM(sold_amount) AS NUMBER(11, 2)) * 1
    ELSE CAST(SUM(sold_amount) AS NUMBER(11, 2)) / 100
  END                         AS invoice_total,
  CAST(NULL AS NUMBER(11, 2)) AS AMOUNT_ADVANCE_PAY,
  CAST(NULL AS NUMBER(11, 2)) AS AMOUNT_OF_GOODS,
  CAST(NULL AS NUMBER(11, 2)) AS AMOUNT_NON_GOODS,
  CAST(NULL AS NUMBER(11, 2)) AS AMOUNT_DISCOUNTS,
  'N'                         AS ON_HOLD_FLAG,
  'F6581001'                  AS IDRS_NAME,
  NULL                        AS RUN_DATE,
  NULL                        AS FIX_DATE,
  NULL                        AS RUN_DATE_PREV
FROM I_0470002_LOG_T A
WHERE A.SALES_DATE IN('121115', '121116', '121117', '121118', '121119', '121120', '130130', '130131')
AND A.SOLD_AMOUNT != 0
GROUP BY A.STO_NO,
  A.CUR_CODE,
  A.RECEIPT_NO,
  A.CASH_NO

Similar Messages

  • Imported CD songs are each put into a separate album. How can I group them in one album?

    Imported CD songs are each put into a separate album. How can I group them in one album?

    Look at Steve MacGuire's helpful article:  http://samsoft.org.uk/iTunes/grouping.asp

  • How do I group the responses in a single cell...

    Hello,
    I have created a form in FormCentral.  The form is broken down into several groups of checkboxes.  Each group has a heading such as: 5 years old, 6 years old, 7 years old, etc...
    With the form created using FormsCentral, exported as a PDF (to add calculations) and then imported back into FormsCentral the grouping remain intact in the 'View Responses' area.  Example: The '6 years old' section displays the name of all of the 6 year old selected checkboxes.  The '7 years old' section displays the name of all of the 7 year old selected checkboxes, etc...
    Because the FormsCentral application doesn't provide a great deal of visual customization I am now trying to create my form using InDesign CC.  Now, the items take up their own spreadsheet column and don't group together inside the 'View Responses' area as before.  My question is: how do I group together item in the PDF so that they retain their grouping within FormsCentral as before? 
    My belief is that it has something to do with the naming conventions used on the various checkboxes.  Yet, I cannot quite figure out the pattern. 
    Any help is greatly appreciated.
    Thanks!
    -David

    Hi,
    >>My question is: how do I group together item in the PDF so that they retain their grouping within FormsCentral as before?
    Please try to rearrange your columns in FormsCentral View Responses table. You can select a column (or columns) and move it next to another column, then select the "T" icon which stands for "Text" formatting in Toolbar, here you can change the title of the Column or the text in each responses to a different color/background color.
    Hope this helps,
    Thanks,
    Lucia

  • How to remove group in XML Publisher template

    Hi All,
    How to remove group in XML Publisher template while desining as below is one example in that i want to remove the group no 2,3,4 or G Supp Seq,List G Audit,G Audit and want the output of line no 1 and 5 and then 1 or Batch / Entry/ Category/ List G Supp Seq/C Line No / C Transaction / C Document//C Credit/C Debit/C H Seq Name.
    Example:
    1) Batch / Entry/ Category/ List G Supp Seq                    /C Credit/C Debit/C H Seq Name                    
    2)          G Supp Seq
    3) List G Audit
    4) G Audit     
    5)     C Line No / C Transaction / C Document
    Kindly help how to generate the output without the line no 2,3,4.
    Regards,
    Sushant

    Sushant,
    you can try to design the RTF by Regrouping the XML data based on your requirement then you may get proper order.
    Please see the Regrouping XML concept in the user guide.
    Regards,
    Prasad Raju

  • I want to copy video, cutaways and audio combined and use in another project. So far I can only copy the video clip or one of the other elements at a time. How do I group all of them?

    I want to group my  video clip with its audio and cutaway clips so that I can copy the segment and move it to another project. So far I can only move one element at a time. How can I group all the elements?

    You can select multiple objects in the timeline in the usual Mac way - hold down the shift key while you click on the objects then copy, select other project, position playhead where you want to insert then paste.
    Geoff.

  • How to set group contacts in nokia asha 305

    how to  set group contacts  in nokia asha 305....thank u......

    Can Some one Tell same group contact creation for ASHA 308 too?

  • HOW CAN I GROUP AND DELETE TEXT MESSAGES IN BULK

    HOW CAN I GROUP AND DELETE TEXT MESSAGES IN BULK

    message - edit - select each text message - delete.
    that is the only method to delete message on your iphone.

  • How to use GROUP BY  in ODI

    how to use GROUP BY in ODI tool

    Hi ,
    you can combine the insert stamt with the select ....so that in the target u will get a single line .....
    SQL> select * from prop_details;
    PROPERTY RELAVANTD NOTICES
    10100 25-JAN-09 30
    10100 03-JAN-09 30
    10100 02-DEC-08 20
    10100 01-DEC-08 10
    10100 31-DEC-08 20
    10101 10-JAN-09 10
    10101 20-JAN-07 15
    10101 30-DEC-08 45
    10101 20-FEB-08 35
    10101 31-JAN-09 25
    10 rows selected.
    SQL> select PROPERTY,max(RELAVANTDATE),SUM(NOTICES) from PROP_DETAILS GROUP BY P
    ROPERTY;
    PROPERTY MAX(RELAV SUM(NOTICES)
    10101 31-JAN-09 130
    10100 25-JAN-09 110
    SQL>

  • How to order / group a report by a placeholder column ?

    How to order / group a report by a placeholder column populated by the group filter ?
    In more detail .....
    My Data model editor's select statement brings back (say 1000 rows) from the database.
    The group filter decides (on performing certain validations) whether to print a row or not in the report.
    Additionally the group filter calculates a "rule type" (just a rule number to say on basis of what rule, the row was selected)
    I would like to order/group the report on the placeholder column which was calculated by the group filter ?
    Obviously, I won't be able to add the "ORDER BY :CP_RULE_NUMBER" in the sql statement as the placeholer column cp_rule_number
    is determined by the group filter level only. (If I do, I get a frequency error)
    Any ideas ?
    Thanks in advance.
    Edited by: user553361 on 8/10/2008 17:35

    how is the group filter implemented?
    If its pure PL/SQL, what about putting the filter-procedure in a stored function into the database? Then you could use the group filter in your query.

  • How to send group emails from ipad

    How to send group emails from ipad

    Thanks.  So matters haven't changed.  Ipad and iohone systems still not make use of the groups created in OSX Contacts, although one can "see" the groups synced through iCloud.  They just do not function as real distribution lists in Mail.
    With the Mailshot app, one creates Mailshot groups with Mailshot group name.  It's as smooth as a work around can get.
    Silly that Apple iOS folks never got around to connecting the contact groups now listed in iOS Contacts through iCloud syncing to also be fully functional in iOS Mail for the purpose of group emailing. 

  • HT3529 how to send group messages in ios 7.0.2

    please tell me how to send group messages in iphone 5 with ios7.0.2

    Oh yeah, now I remember that.
    But I also remember that you had to go all the way to the start of the message to gain access to the current contact information. Where as in iOS7 that button you mentioned is the contact information. Personally I perfer iOS7. I don't delete my messages, so this is better for me.
    However, it wouldn't be a bad idea to add an Edit button in that sub menu that shows up when you touch the upper right button. Currently there are opitions for "Phone", "FaceTime" and "Information" on the contact.
    KOT

  • How to change group colors

    How to change group color in ical

    To change group colors:
    highlight 'desired' group,
    under <Edit>, choose <Get Info>,
    this should give you a smaller window:
              'desired' Info
              Name: desired                    Box with color choices
                                                       (dropdown colors; 'other' accesses other color palettes)
              Description: (can be added)
              Box ' Ignore alarms'
              'Publish...'                    'Cancel'                    'OK'
       4. make color choice,
       5. choose <OK> to complete color change, or <Cancel> original color remains.
    I do hope I've gotten this correct.

  • How to Perform Group By operation in OBIEE 11g

    Hi,
    I have created a report for the "Nationality count in department wise manner", since for this i need to give 'group by department' for getting correct answer...
    But in OBIEE 11g on presentation service how i need to give "Group BY" operation....for viewing correct count in nationality wise......
    Regards,
    Harry...

    Hi sai,
    U mentioned, but i couldn't clearly able to understand that.......Since to perform Group By i need to make some setting changes in content in Advanced Tab setting like that it is mentioned, but i need to perform in the following manner
    select count(nationality), nationality
    from per_all_people_f, per_all_assignment_f, hr_all_organization_units
    group by department
    Note: per_all_people_f-----------> dimension table, per_all_assignment_f--------------> fact table
    nationality from per_all_people_f and count(nationality) from per_all_assignment_f
    But department is from hr_all_organization_units--------->dim table
    I dont want to see the departments but i need to group the result in department manner that i was taking from the table hr_all_organization_units.....
    How to perform Group BY in OBIEE 11g.......
    Thanks,
    Harry.........

  • How to hide Group Tree in Crystal Report Server.

    Hi all visitors
    i have created one crystal report and my report use group to summary the amount of each day.
    after i use group to summary, i used text box cover the group. so my group can't click anything.
    After that i upload my report to crystal report server, when i viewed my report and when i click on Group Tree, it will show the list of group (group date in crystal report) and it also can click. I don't want to show the Group Tree in Crystal Report Server.
    Anybody know how to hide group tree in crystal report server?
    Best Regards,

    Are you talking custom application, or infoview?  If it is custom app, you would have to look at the setToolPanelViewType method.  if its infoview, no direct way to change this that i know of.

  • How to set group name as default value in People Picker in Infopath 2010

    How to set group name (shareoint Groupname)  as default value in People Picker in Infopath 2010

    Under the Developer tab in Infopath you can manage Loading Events, unfortunetly i dont have Visual Studio on this PC so i cant laborate, but i believe it's rather simple to figure out.
    Edit: Found a easier way, through Data > Default Values.

Maybe you are looking for

  • I am getting following error when index rebuild

    SQL> ALTER INDEX VECTORMAPLIN_IXS REBUILD; ALTER INDEX VECTORMAPLIN_IXS REBUILD ERROR at line 1: ORA-14086: a partitioned index may not be rebuilt as a whole i have given alter index VECTORMAPLIN_IXS REBUILD partition; but i am getting error plseas s

  • Log4j error on exceution

    Hi, I have an application that uses log4j for logging purpose. I designed this is Windows using eclipse. So, what happened was I placed the "log4j.properties" file in the <package name>/bin/ folder and the program could read the log4j.properties file

  • Dynamic selction tables and fields

    Hi Folks, I have an issue while creating program using field symbols My requirement is I need to develop a program to get table counts with respect to username and date .For that I wrote below program REPORT  ZDYNAMICFIELDS. PARAMETERS: TABNAM TYPE D

  • Problem in handling Before_User_Command Event in CL_GUI_ALV_GRID class

    Hi, I have created an ALV grid control and I am also handling the before_user_command event of cl_gui_alv_grid class. My aim is to use POPUP_TO_CONFIRM function module when the users click on the add/delete row button. Control is going to the event i

  • Search result in a batch size of 10

    We are using webcenter live search. When we search we get 5 results on a page and to view other results we have pagination (1 2 3 ...). My requirement is to show 10 reuslts per batch instead of 5. I don't see any task-flow parameter is exposed there.