Creating a  query with group function and non group function

Could anyone help me with creating a query that contain single row function and multiple row function in Report6i.
what i want to do basically is to create a query that will display sum of certain columns according to a column in that table

You can either calculate a sum yourself, or let Reports do it for you.
1. select sum(column) from table where ....
This will just display the sum, not the records.
2. Make a query: select column from table where ...
Create a summary field. You can do it manually or with the report wizard.
That will create a report like this:
   Column
       10
       20
       15
   ======
Sum    45                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • Query with MARA MVKE and MAST

    Hi
      Im trying to create a query with MARA, MVKE and MAST tables. If corresponding records exist in all the 3 tables, I get output. Otherwise, I get the result as 'No data selected'. I tried using left outer join with MAST , tried using MARC also between MARA and MAST but its of no use. Please suggest how I can both get the sales data and BOM details in the output.
    Thanks
    Aparna

    Hi Aparna,
    Goto  SE16 Check in table,
    1.KDST -
    Sales order to BOM link
    2.STKO -
    BOM - header
    3.STPO -
    BOM - item
    And also you create a query and check the out put.

  • How do I create a folder or report from a query with a union and parameters

    I have created folders with unions but I am having difficulty coverting a query with a union and parameters.
    The following works great in SQL*Developer without parameters, but I want to change to use parameters for the year and quarter and use it in Discoverer:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
      AV.FIRM_NAME VENDOR_NAME,
      AV.BIDCLASS CONTRACT_CODES,
      AV.AWAMT AWARD_AMOUNT,
      AV.SOL_MODE FORMAL_INFORMAL,
      AV.CERT BUSINESS_ENTITY,
      AV.ETHNICITY ETHNICTY,
      AV.PO_NUMBER_FORMAT CONTRACT,
      SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
      CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID       = VP.VENDOR_ID ) )
    AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')
    AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
      AV.FIRM_NAME,
      AV.BIDCLASS,
      AV.AWAMT,
      AV.SOL_MODE,
      AV.CERT,
      AV.ETHNICITY,
      AV.PO_NUMBER_FORMAT
      union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
      AV2.FIRM_NAME VENDOR_NAME,
      AV2.BIDCLASS CONTRACT_CODES,
      AV2.AWAMT AWARD_AMOUNT,
      AV2.SOL_MODE FORMAL_INFORMAL,
      AV2.CERT BUSINESS_ENTITY,
      AV2.ETHNICITY ETHNICTY,
      AV2.PO_NUMBER_FORMAT CONTRACT,
      0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
                  FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
                 WHERE av2.po_number = vp2.po_number
                       AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = '4')
                       AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = '2009' ))
    AND (TO_CHAR(AV2.AWDATE,'Q') = '4')
    AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
      AV2.FIRM_NAME,
      AV2.BIDCLASS,
      AV2.AWAMT,
      AV2.SOL_MODE,
      AV2.CERT,
      AV2.ETHNICITY,
      AV2.PO_NUMBER_FORMAT Can someone provide a solution?
    Thank you,
    Robert

    Hi,
    You can take the parameters to the select so that you will be able to create conditions over them.
    Try to use this SQL instead of your and in the discoverer workbook create the conditions and parameters:
    SELECT TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000') FEID,
    AV.FIRM_NAME VENDOR_NAME,
    AV.BIDCLASS CONTRACT_CODES,
    AV.AWAMT AWARD_AMOUNT,
    AV.SOL_MODE FORMAL_INFORMAL,
    AV.CERT BUSINESS_ENTITY,
    AV.ETHNICITY ETHNICTY,
    AV.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    SUM(VP.INVOICE_AMOUNT) AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV,
    CONFIRM.VSTATE_VENDOR_PAYMENTS VP
    WHERE ( ( AV.PO_NUMBER = VP.PO_NUMBER
    AND AV.VENDOR_ID = VP.VENDOR_ID ) )
    --AND (TO_CHAR(VP.PAYMENT_DATE,'Q') = '4')*
    --AND ( TO_CHAR(VP.PAYMENT_DATE,'YYYY') = '2009' )*
    GROUP BY TO_CHAR(NVL(AV.TAX_ID,999999999),'000000000'),
    AV.FIRM_NAME,
    AV.BIDCLASS,
    AV.AWAMT,
    AV.SOL_MODE,
    AV.CERT,
    AV.ETHNICITY,
    AV.PO_NUMBER_FORMAT ,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    union
    SELECT TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000') FEID,
    AV2.FIRM_NAME VENDOR_NAME,
    AV2.BIDCLASS CONTRACT_CODES,
    AV2.AWAMT AWARD_AMOUNT,
    AV2.SOL_MODE FORMAL_INFORMAL,
    AV2.CERT BUSINESS_ENTITY,
    AV2.ETHNICITY ETHNICTY,
    AV2.PO_NUMBER_FORMAT CONTRACT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    0 AMOUNT_PAID_$
    FROM CONFIRM.VSTATE_PAID_AWARD_VENDORS AV2
    WHERE
    not exists (SELECT 'X'
    FROM CONFIRM.VSTATE_VENDOR_PAYMENTS VP2
    WHERE av2.po_number = vp2.po_number
    AND (TO_CHAR(VP2.PAYMENT_DATE,'Q') = TO_CHAR(VP.PAYMENT_DATE,'Q') )
    AND ( TO_CHAR(VP2.PAYMENT_DATE,'YYYY') = TO_CHAR(VP.PAYMENT_DATE,'YYYY') ))
    --AND (TO_CHAR(AV2.AWDATE,'Q') = '4')*
    --AND (to_CHAR(AV2.AWDATE,'YYYY') = '2009')*
    GROUP BY TO_CHAR(NVL(AV2.TAX_ID,999999999),'000000000'),
    AV2.FIRM_NAME,
    AV2.BIDCLASS,
    AV2.AWAMT,
    AV2.SOL_MODE,
    AV2.CERT,
    AV2.ETHNICITY,
    AV2.PO_NUMBER_FORMAT,
    TO_CHAR(VP.PAYMENT_DATE,'YYYY') P_YEAR,
    TO_CHAR(VP.PAYMENT_DATE,'Q') P_QTR
    Tamir

  • Linking Access tables, creating a query with using both Access and Oracle

    Hello,
    I am using 3.0.04.34 version Oracle Developer. I am supposed to create a script/procedure to use both Access tables and oracle tables together. There is an option in developer to copy the access tables into oracle. But it doesn't help me. Because when we updated the access tables
    the copied ones are not be updated. How can I created a linked access tables to oracle and create a query with using both access and oracle table together.
    I will appreciate if you guys help me. I look forward to hearing from you guys.
    Thanks,
    Pinar

    Pinar,
    to be able to query MS Access tables in Oracle you need an additional product, the Oracle Database Gateway for ODBC. It allows you to link any foreign database into an Oracle database using a suitable ODBC driver. You can then access the MS Access tables through a database link based on the Database Gateway for ODBC. This will also allow you to join local Oracle and remote MS Access tables from your Oracle database.
    There's a note on My Oracle Support which gives you more details:Document 233876.1 Options for Connecting to Foreign Data Stores and Non-Oracle Databases - For example - DB2, SQL*Server, Sybase, Informix, Teradata, MySQL
    And there's also a dedicated Forum: Heterogeneous Connectivity

  • How to create sap query with "or" relationship

    dear experts,
    I need a report to display the employee whoese WSR is
    changed in the month for infotype 0007.
    that is ,we want to search with selection
    begda OR endda between 2008-01-01 and 2008-01-31.
    how to create sap query with "or" relationship?

    hi use like this,
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr                 =  p_pernr
        infty                   =  '0007'
       BEGDA                =  p_date1
       ENDDA                 = p_date2
      TABLES
        infty_tab             = itab .
    hi use this by passing the pernr to fm and giving the dates low and high in the p_date1 and p_date2.
    loop at itab where condition.
    endloop.
    may it helps u,
    regards,
    venkat.

  • How can I create a query with tables in INFOSET?

    Dear Gurus,
    How can I create a query with tables in INFOSET?
    Just tables and fields INFOSET?
    Kind Regards,

    Hello
    Check following SCN Article for your understanding/reference:
    - [Using Infoset Query ,SAP Query and Quick Viewer|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5]
    Regards
    JP

  • How can I create a query with web service data control?

    I need to create a query with web service data control, in WSDL, it's query operation, there is a parameter message with the possible query criteria and a return message contains the results. I googled, but cannot find anything on the query with web service. I cannot find a "Named Criteria" in web service data control like normal data control. In Shay's blog, I saw the topics on update with web service data control. How can I create a query with web service data control? Thanks.

    Hi,
    This might help
    *054.     Search form using ADF WS Data Control and Complex input types*
    http://www.oracle.com/technetwork/developer-tools/adf/learnmore/index-101235.html

  • Absolute dynamic select query with dynamic join and where

    Has anyone ever tried creating an absolutely dynamic SELECT query with dynamic Join and Where conditions.
    I have a requirement of creating such a query in an Utility Class, and i have written the code. But its throwing my sysntax errors.
    Please let me know where am I going wrong OR is it really possible to create such a dynamic Query??
        SELECT (FIELDS) INTO TABLE IT_TABLES
          FROM ( (ME->TABLE1)  inner join ( me->table2 )
          on ( on_condition ) )
          WHERE (me->where_fields).
    Ags.

    It worked for me in a following way:
    select * into corresponding fields of table <result_table>
            from (join_string)
            where (l_where).
    Where the contents of join_string were dynamically build using concatenation. So it will be something like
    concatenate ME->TABLE1 'as a INNER JOIN' me->table2 'as b ON (' into join_string separated by space.
    <...>
    add here matching/reference colums, something like
    concatenate 'a~' me->TABLE1_JOIN_COL into temp1.
    concatenate 'b~' me->TABLE2_JOIN_COL into temp2.
    concatenate join_string temp1 '=' temp2 into join_string separated by space.
    <...>
    concatenate join_string ')' into join_string separated by space.
    And then use similar approach for l_where variable.

  • Hi I created a EPUB with indesign cc and I'm trying to submitted it to iTunes Producer

    Hi I created a EPUB with indesign cc and I'm trying to submitted it to iTunes Producer and only thing that happens is the little wheel keep spinning and spinning and spinning can you help? And is there a way to  decrease the size of my EPUB I'm getting a message saying that it is over 200 MB?

    You haven't said if you're on a mac or PC. I understand that on a PC you can directly open an EPUB. But, as I am on a Mac I need a utility. I use a little app called EPUB Unzip and then to zip it back up you'll need EPUB zip. Just search on Google for them. They are open source (free). Or you can use Sigil to get into the EPUB without unzipping. Sigil is good, but does change the file structure a little bit, and for that reason some people don't like it. For a reflowable EPUB it doesn't matter much. Though I don't think I'd open a fixed layout EPUB with it. Sigil is also open source—it's very easy to use, too.
    You'll also want an EPUB validation app. I use Pagina EPUBcheck 3.01 (open source). Or you can use the free online checker here: EPUB Validator (beta) though it's for SMALL files. I like Pagina because it suggests fixes for errors—even though those fixes may be completely greek to you and me.
    Finally, I really suggest you get a subscription to Lynda.com and watch everything Anne Marie Concepcion has ever done on EPUB. While not the be all and end all, her knowledge is a very good place to start. Lynda.com is $25 per month but you can quit anytime (though um, I haven't, because well it's kind of addicting). So, even if you only use it for a month, you'll learn a ton and it'll be well worth it.
    Lest I sound like some kind of freakin' expert, let me assure you this is a long and painful process, with little help out there for us "non-programmer" types who've been thrown in the lion's den. I am still learning everyday, by my own wits it sometimes seems.  Even today I am learning (most painfully yet) how to program a fixed layout read-abound book by trial and error, because even after BEGGING Adobe ON BENDED KNEES we don't have support for read-aloud and according to insiders hereabout they have NO PLANS to give us that. Yes. I am going to continue to whine about it, frequently.
    It's late, and I've already had a glass or two of wine. (Not that you'd notice. ) Good luck on your journey. (Only 8 more circles of hell to traverse, so I've heard.) 

  • How to create a contract with one supplier and two dealers?

    Hi Gurus,
    I have a contract with a supplier (eg. Apple), but the products and services are supplied by two dealers.
    The supplier is the manufacturer and with whom the negotiation of prices is made.
    The dealers are those who make the delivery of the products and services and who the payment is done.
    How can I create a contract with these characteristics in SRM 7.0?
    I don't want to create two contracts with same products and services for two suppliers (Dealer_1 and Dealer_2).
    How can this be handled through business partner type "Vendor"?
    In "Partner" section in "Header" --> "Basic data", I can only add 1 vendor.
    The system is:
    Component software: SRM_SERVER
    Release: 700
    Level: 0008
    Support package: SAPKIBKV08
    Thanks in advance and best regards,
    Alonso Valenzuela

    Hi Wadim,
    I have a similar requirement to create order lines in an existing contract with reference using  BAPI_CUSTOMERCONTRACT_CHANGE.  The order lines get created in the contract. However, the condition types from the order line which i'm referencing are not getting referenced and are not getting added in the Contract's line after referencing.
    Did you come across any such issue ? If yes , could you suggest the solution ?
    Regards,
    Venkat.

  • HT204088 Dear sirs,  Could you please help me on my problem with my apple ID  I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,  My account have 50$ and stil

    Dear sirs,
    Could you please help me on my problem with my apple ID
    I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,
    My account have 50$ and still didn't buy anything

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (100546)

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • Problem creating a table with a subquery and a dblink

    Hello!!
    I have a little problem. When I create a table with a subquery and a dblink, for example:
    CREATE TABLE EXAMPLE2 AS SELECT * FROM EXAMPLE1@DBLINK
    the table definition is changed. Fields with a type of CHAR or VARCHAR2 are created with a size three times bigger than the original table in the remote database. Field of type DATE and NUMBER are not changed. For example if the original table, in the database 1, has a field of type CHAR(1) it is create in the local database with a type of CHAR(3), and a VARCHAR2(5) field is created with VARCHAR2(15).
    Database 1 has a WE8DEC character set.
    Database 2 has a AL32UTF8 character set.
    Could it be related to the difference in character sets?
    What can I do to make Oracle use the same table definition when creating a table in this way?
    Thanks!!

    That is related to character sets, and probably necessary if you want all the data in the remote table to be able to fit in the new table.
    When you declare a column VARCHAR2(5), by default, you're allocating 5 bytes of storage. In a single-byte character set, which I believe WE8DEC is, that also happens to equate to 5 characters. In a multi-byte character set like AL32UTF8, though, 1 character may require up to 3 bytes of storage, so you'd need to allocate 15 bytes to store that data. That's what's going on here.
    You could still store all the data if you create the table locally by explicitly requesting 5 characters of storage by declaring the column VARCHAR2(5 CHAR). You could also set the NLS_LENGTH_SEMANTICS parameter to CHAR rather than BYTE before creating the table, but I believe that both of these will only apply when you're explicitly defining columns as part of your CREATE TABLE. I don't believe either will apply to CTAS statements.
    Justin

  • How to create a matrix with constant values and multiply it with the output of adc

    How to create a matrix with constant values and multiply it with the output of adc 

    nitinkajay wrote:
    How to create a matrix with constant values and multiply it with the output of adc 
    Place array constant on diagram, drag a double to it, r-click "add dimension". There, a constant 2D double array, a matrix.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Compiler error with default arguments and static template function

    Hi 
    The following does not compile with visual studio 2010 sp1, and compiles with gcc.
    #include <string>
    class A
    public:
       template<class T>
       static T& Get(const std::wstring&);
    class B
     public:
      void f(
        double d,
        double c =A::Get<double>(L"test"));
    int main()
        B b;
        b.f(5);
    It gives me the following error 
    error C2783: 'T & A::Get(const wchar_t *)' : could not deduce template argument for 'T'
    If I change Get to be global function and not static function of A, it compiles.

    It seems to be a compiler bug.  It fails in VS2012, but compiles in VS2013.
    For completion sake, the problem exists if A is a namespace containing Get.  But not if Get is global.
    The only solutions I can see are try to workaround the problem (make Get global) or upgrade to a newer version of VS.

Maybe you are looking for