How to use single column in a group by clause

hi frs
i hve used sum function in a sql how to use a single column in a query.
for ex
select sum(sal),ename,job,deptno,empno from emp
group by deptnowhether its possible to use single column in a group by class.
i want like this because in my custom report i need it. Report query has more than 30 column so its not possible to use 30 columns in a group by.
pls help.
Thanks
Rajesh

Maybe something like this -
Select ename, job, deptno, empno, sal, col1, col2, col3, col4 ......, coln
From
Select SUM(sal) sal, deptno deptno_i
From Emp
Group By deptno
,Emp
Where deptno = deptno_i
Shailender Mehta

Similar Messages

  • How to use the Columns Hidden | space in the bottom of af:panelCollection?

    Hi,experts,
    In jdev 11.1.2.3,
    I can see a row of Columns Hidden | Columns Frozen in the bottom of component af:panelCollection - pc1 which have an af:table - t1 component inside in designer view,
    and can see there is a blank row space only with "|" inside when the page is running.
    Now I want to use this blank row space such as to display row numbers for the table, so I set the property for the panelColletion as following source code:
    ==========================
    <af:panelCollection id="pc1" inlineStyle="width:1250px; height:500px;">
    <f:facet name="menus"/>
    <f:facet name="toolbar"/>
    <f:facet name="statusbar">
    <af:group id="g4"/>
    </f:facet>
    <af:table value="#{bindings.TView1.collectionModel}" var="row"
    rows="#{bindings.TView1.rangeSize}"
    emptyText="#{bindings.TView1.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.TView1.rangeSize}" rowBandingInterval="1"
    filterModel="#{bindings.ImplicitViewCriteriaQuery.queryDescriptor}"
    queryListener="#{bindings.ImplicitViewCriteriaQuery.processQuery}" filterVisible="false"
    varStatus="vs"
    selectedRowKeys="#{bindings.TView1.collectionModel.selectedRow}"
    selectionListener="#{bindings.TView1.collectionModel.makeCurrent}"
    rowSelection="single" id="t1" inlineStyle="font-size:xx-large; font-weight:bolder;">
    <af:column sortProperty="#{bindings.TView1.hints.GoodsStatus3.name}" filterable="true"
    sortable="true"
    headerText="#{bindings.TView1.hints.GoodsStatus3.label}"
    id="c42">
    <af:outputText value="#{row.GoodsStatus3}" id="ot33"/>
    </af:column>
    <f:facet name="footer">
    <af:group id="g3">
    *<af:outputText value="RowsNumber:" id="ot44"/>*
    *<af:outputText value="#{bindings.TView1Iterator.estimatedRowCount}"*
    id="ot43" partialTriggers="::pc1:t1"/>
    </af:group>
    </f:facet><f:facet name="detailStamp"/>
    </af:table>
    </af:panelCollection>
    =====================
    but when run the page there is no display for the row number, instead on the bottom of the table, there is only a blank row with "|" inside.
    How to use the Columns Hidden | Columns Frozen space in the bottom of component af:panelCollection ?
    Thanks!

    Hi, Arun
    It works.
    As in my use case, can draw an af:toolbar component into statusbar of Panel Collection facets in Structure view.
    There is still a small issue:
    cannot see the Columns Hidden|Columns Frozen component in the Structure view,
    and if drop more than one af:toolbar into statusbar, the sencond one will fall/wrap into second row, even though there is enough space on the first row (to occupy a second row in statusbar will be a waste of space), and cannot see how to adjust.
    Thank you very much!
    bao

  • How to use single sign on to authenticate

    How to use single sign on to use the MS-AD for authentication
    I have created an data source which points to the MS-AD and tested
    Next how do i add this to the policies.
    Thanks
    NS

    Hi,
    Please, specify the products and versions that you are using?
    thanks,
    Thiago Leoncio

  • EREC - How to use link generated by application group?

    How to use link generated by application group?

    Hello Vishal,
    You provide the link eg. in a list and candidates just have to click on that if they want to apply.
    Regards
    Nicole

  • More than 1 column in the group by clause

    DB Version:10gR2
    I understand the basics of GROUP BY clause. I have a question on why we have on more than 1 columns in GROUP BY clause.
    In the below example, the course name by itself does not make up a group. A Course name plus its BeginDate make up a group. This is the whole point of having more than 1 columns in the GROUP by clause. Right?
    SQL> select r.course, r.begindate , count(r.attendee) as attendees
      3   from registrations r
      4   group by r.course, r.begindate
      5   order by course
      6  /
    COURSE BEGINDATE      ATTENDEES
    JAVA    12/13/1999           5
    JAVA    2/1/2000             3
    OAU     8/10/1999            3
    OAU     9/27/2000            1
    PLS     9/11/2000            3
    SQL     4/12/1999            4
    SQL     10/4/1999            3
    SQL     12/13/1999           2
    XML     2/3/2000             2

    ExpansiveMind wrote:
    Thanks Dmorgan. I am just learning the basics of GROUP BY clause. I have noticed that all Non-aggregate columns in SELECT list have to be present in the GROUP BY clause. I thought it was a "syntactical requirement". Now, i realise that these columns are present in the GROUP BY clause because only a combination of columns make up a group.Well, it is a bit of both actually. It is a syntactic requirement that all non-aggregated columns in the select list must appear in the group by clause. However, the non-aggregated columns in the select list is what defines your group. Your two examples define two different groups, and would answer two different questions.
    John

  • How to use partition by instead of group by?

    Hi,
    I am having trouble using partition by clause in following case,
    column other_number with null values contains 10 records in 'some_table'
    5 records with date 11-01-2009, item_code = 1
    5 records with date 10-01-2009, item_code = 2
    This query returns all 10 records, (which suppose to return 2)
    SELECT count (a.anumber) over (partition by TO_char(a.some_date,'MM'), a.item_code) AS i_count, a.item_code,
    TO_char(a.some_date,'MM')
         FROM some_table
         WHERE to_char(a.some_date,'yyyy') = 2009
         AND a.other_number IS NULL
    Works fine if I wrote like this,
    SELECT count (a.anumber) AS i_count, a.item_code,
    TO_char(a.some_date,'MM')
         FROM some_table
         WHERE to_char(a.some_date,'yyyy') = 2009
         AND a.other_number IS NULL
    group by TO_char(a.some_date,'MM'), a.item_code
    How to use partition by in this case?

    Hi,
    Almost all of the aggregate functions (the ones you use in a GROUP BY query) have analytic counterparts.
    You seem to have already discovered that whatever values are returned by
    an aggregate funcition using "GROUP BY x, y, z" can also be found with
    an analytic function using "PARTITION BY x, y. z".
    Aggregate queries collapse the result set.
    The aggregate COUNT function:
    SELECT    deptno
    ,         COUNT (*)   AS cnt
    FROM       scott.emp
    GROUP BY  deptno
    ;tells how many of the 14 employees are in each of the 3 departments.
    So does the analytic COUNT function:
    SELECT    deptno
    ,         COUNT (*) OVER (PARTITION BY deptno)   AS cnt
    FROM       scott.emp
    ;but the first query produces 3 rows of output, the second query produces 14.
    You could get 3 rows of output using the analytic function and SELECT DISTINCT , but it's inefficient.
    Which should you use? Like so many other things, the answer depends on what data you have, and what results you want from that data.
    If you want collapsed results (one row per group), that's a striong indication that you'll want aggregate, not analytic functions.
    If you want one row of output for every row in the table, that's a strong indication that you'll want analytic functions.
    If you have a particular question, ask it. Post some sample data and the results you want from that data, as Rob said.
    There is another important difference between aggreate and analytic functions: analytic functions can easily be restricted to a window , or subset, of the data set. This is something like a WHERE clause, but a WHERE clause applies to the whole query: a wondowing condition applies only to an individual row.
    If you need to compute a SUM of rows with an earlier order_date than this row or an average of the last 5 rows, then you proabably want to use analytic function.

  • How to do Single Column Visble and Invisible

    Hi All,
    I tried following code for doing Column visible and invisible. But in this when i click single columne all values invisible. I want when i again click on that Column i want to bind previuse value.
    Means i have taken one Matrix and in that Matrix of first column i taken ChooseFromList and on this i fill second column also. When i click on second column it invisible. I want when i click again i want bind that value which i got on ChooseFromList.
    I tried hardcode value "X". That line commented in code.
    Can anybody suggest me how to do it ? How to get again that value ?
    Code is,
    If pVal.ColUID = "V_0" Then
                    For i = 0 To matrix.RowCount - 2
                        If matrix.Columns.Item("V_0").Cells.Item(i + 1).Specific.Value = "" Then
                            '   matrix.Columns.Item("V_0").Cells.Item(i + 1).Specific.Value = "X"
                        Else
                            matrix.Columns.Item("V_0").Cells.Item(i + 1).Specific.Value = ""
                        End If
                    Next
                End If

    Hi,
    I guess i understood now.. Plz bind all ur cols in the matrix u can take a look at the following code snippent to bind the cols
    oForm.DataSources.UserDataSources.Add("Usr1", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50)
    objMatrix = oForm.Items.Item("matIndent").Specific
    oCol = objMatrix.Columns.Item("V_20")
    oCol.DataBind.SetBound(True, "", "Usr1")
    oForm.DataSources.UserDataSources.Add("Usr2", SAPbouiCOM.BoDataType.dt_SHORT_TEXT, 50)
    objMatrix = oForm.Items.Item("matIndent").Specific
    oCol = objMatrix.Columns.Item("V_21")
    oCol.DataBind.SetBound(True, "", "Usr2")
    Execute this code after the form is loaded. (U can use the load Event or if the form is loaded with the Menu u can also use the menu event.)
    Hope it helps,
    Vasu Natari.

  • How to access single column in table?

    Hi,everybody!
    How to access a single column in table.
    I sorted my table with standard TableSorter.
    Now I need to get one column from this table to
    do something with it's data.How do I get it?
    Regards,
    Michael

    Hi Michael,
    If you just want to retrieve the data, you could use the following code.
    //Get the node which the table is bound to
    IWDNode node = wdContext.nodeTable();
    //iterate thru the elements
    for(int i = 0 ; i<node.size();i++)
      IWDNodeElement ne = node.getElementAt(i);
      Object value = ne.getAttributeValue("<column name>");
      //Here you have the data in the value variable
      //and you can manipulate this now
    Regards,
    Sudeep

  • How to convert single column into single row

    I need to convert single column into single row having n no.of.values in a column. without using case or decode. I need a query to display as below.
    emp_id
    100
    101
    102
    102
    103
    200
    I need output like 100,101,102,103,104.........200.

    I assume you want to convert 200 rows with one column into one row with 200 columns. If so, this is called pivot. If you know number of rows (max possible number of rows) and you are on 11G you can use PIVOT operator (on lower versions GROUP BY + CASE). Otherwise, if row number isn't known, you can use dynamic SQL or assemble select on clent side. Below is example emp_id = 1,2,..5 (to give you idea) and you are on 11G:
    with emp as (
                 select  level emp_id
                   from  dual
                   connect by level <= 5
    select  *
      from  emp
      pivot(
            max(emp_id) for emp_id in (1 emp_id1,2 emp_id2,3 emp_id3,4 emp_id4,5 emp_id5)
       EMP_ID1    EMP_ID2    EMP_ID3    EMP_ID4    EMP_ID5
             1          2          3          4          5
    SQL>
    SY.

  • How to use the column names generated from Dynamic SQL

    Hi,
    I have a problem with Dynamic SQL.
    I have written an SQL which will dynamically generate the Select statement with from and where clause in it.
    But that select statement when executed will get me hundreds of rows and i want to insert each row separately into one more table.
    For that i have used a ref cursor to open and insert the table.
    In the select list the column names will also be as follows: COLUMN1, COLUMN2, COLUMN3,....COLUMNn
    Please find below the sample code:
    TYPE ref_csr IS REF CURSOR;
    insert_csr ref_csr;
    v_select VARCHAR2 (4000) := NULL;
    v_table VARCHAR2 (4000) := NULL;
    v_where VARCHAR2 (4000) := NULL;
    v_ins_tab VARCHAR2 (4000) := NULL;
    v_insert VARCHAR2 (4000) := NULL;
    v_ins_query VARCHAR2 (4000) := NULL;
    OPEN insert_csr FOR CASE
    WHEN v_where IS NOT NULL
    THEN 'SELECT '
    || v_select
    || ' FROM '
    || v_table
    || v_where
    || ';'
    ELSE 'SELECT ' || v_select || ' FROM ' || v_table || ';'
    END;
    LOOP
    v_ins_query :=
    'INSERT INTO '
    || v_ins_tab
    || '('
    || v_insert
    || ') VALUES ('
    || How to fetch the column names here
    || ');';
    EXECUTE IMMEDIATE v_ins_query;
    END LOOP;
    Please help me out with the above problem.
    Edited by: kumar0828 on Feb 7, 2013 10:40 PM
    Edited by: kumar0828 on Feb 7, 2013 10:42 PM

    >
    I Built the statement as required but i need the column list because the first column value of each row should be inserted into one more table.
    So i was asking how to fetch the column list in a ref cursor so that value can be inserted in one more table.
    >
    Then add a RETURNING INTO clause to the query to have Oracle return the first column values into a collection.
    See the PL/SQL Language doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/returninginto_clause.htm#sthref2307

  • How to use Single sign On in CRM2007 ?

    Dear All,
    I have created a launch transaction for launching ransactions from R3 (using BOR).
    Now, the problem is when I click on the link in WebUI it gives me a popup for entering R3 User Id and only then it allows navigation to R3 transaction.
    How do I remove this popup ? I want that since user has already eneterd password for WebUI it should further not prompt him/her for the password. How to achieve this ?
    Can we use Single Sign on ? How ?
    Regards,
    Ashish

    Hi Stephen,
    I have done the settings as per the OSS notes. But, I am getting the following error while navigating to R3 from CRM (BOR Launch transaction):-
    - SSO logon not possible; browser logon ticket cannot be accepted
    - Choose "Logon" to continue A dialog box appears in which you can enter your user and password
    - No switch to HTTPS occurred, so it is not secure to send a password
    Also, after this I get the popup where I have to enter R3 User Id and Password and then it continues.
    But, the whole purpose was to remove this intermediate popup.
    What settings are missing / going wrong ?
    Regards,
    Ashish

  • How to use single installation of Nokia Ovi Suite ...

    I want to help my adult son set up his (different model-) Nokia Smartphone.
    How to use the Nokia Ovi Suit already installed for a different user?

    Hey,
    If i hav understood ur issue correctly, u want to share the same nokia ovi suite(Contacts, Messages, Calendar and tasks etc) of ur entire family with single nokia ovi suite? If my understaning is wrong, please do correct/educate me.
    AFAIK, nokia ovi suite does not work the same way how pc suite works at least when it comes to PIM sync like Contacts, Messages, calendar and tasks etc.,
    In case of PC Suite, u can connect more than a device and u can sync/store messages/contacts/calendar etc separately and u can switch to the next device, there is no dedicated database to store any of ur data, if u r synching with pc suite.
    In case of Ovi Suite, it has got a database where it stores user's info in a database, so u cannot sync multiple phone's data with single nokia ovi suite.
    If this is what u xpct from our forum, read my signature and do the needful
    If my post helped you, click on Kudos button and if my solution provided is opt 2 u, accpt my solution

  • How to use single connection

    Hello Gurus,
    I am new in adf and using jdev 11.1.2.3.
    I am developing application in which i am using dynamic shell UI. The structure of application is i have one main application modules with the UI shell. The other modules are developed in separate application and has its own data control and task flows and then i deployed them as adf library. Then i am consuming the task flow in the main application.
    As i mention each module has its own data control, so when i open a module it makes new connection with database. It means if i have opened ten modules then it is opening ten connections with database.
    Is is possible i can configure somewhere to use single connection for all modules and not to open the connection for each module.
    And one more thing if i undeploy the application the connection is still with database as v$session view shows it. How i can close connection if i close the tab in ui shell.
    Thanks,

    Hi, You can explore the option of nesting your AM.  Check below links to know more about them.
    Decompiling ADF Binaries: What you may need to know about Nested Application Module
    Nested application modules | ADF KickStart
    Good luck !

  • How to use single frame in a page

    Hello, i would like to now how to make a frame in a page
    without having two or more, i was used to work with GoLive and
    there i could use the grid an put a single frame and make links to
    other pages that would open in that frame, it worked wel for me,
    but since I switched from golive to dreamweaver CS3 i am not able
    to do so. Is there some one how could tel me how to do so, since i
    use a lot of single frames in my pages,
    greetings

    why are you wanting to use single frames?
    They allow having the initial frame address stay in the
    address bar, and not
    show the linked page's address. The problems they cause
    usually override any
    value.
    Or- if we aren't using the same words the same way, please
    give an example
    site of what you want to do.
    Alan
    Adobe Community Expert, dreamweaver
    http://www.adobe.com/communities/experts/

  • How to use single button for different operations

    Hi
    I am using one button with image having 4 controls like left right up and down...
    How to use the single button for 4 different operations??
    Is there any way of defining hotspots on single button to do four different operations...
    Please have a look at the attached image, u can understand my problem better...
    Please let me know ASAP...
    Thanks and Regards
    Aruna.S.N.

    Here ya go:
    http://code.google.com/p/flexlib/wiki/ComponentList
    If this post answers your question or helps, please mark it as such.

Maybe you are looking for

  • How do I share a slidshow with firends?

    I would like to share a slideshow complete with sound with friends. Some have windows computers and some do not. I know how to do it for MAC people but not for the windows people. Is there a way???

  • How to start development? What is missing?

    I just downloaded .Net connector and install it to my computer. I created a Windows application project, added a SAP connector class from the menu, and SAPProxy1.sapwsdl and SAPProxy1.cs files were generated. I can see BORs and functions in the serve

  • Java BeanShell expression in ODI

    hi experts, i am working on ODI 11 g (11.1.1) i have found java beanshell expression in standard ODI KM (IKM "IKM Oracle Slowly Changing Dimension", step 192 "Analyze integration table"): <%=odiRef.getTable("L","INT_NAME","A").replaceAll("","").repla

  • Debugging a custom realm in WLS 6.1

    Hi all. I'm trying to find out how to debug my custom realm. I first implemented the DebuggableRealm and put log.debug calls in my realm. I then set the realm.debug property to "true" when I start the server. Is that it? The javadocs on debugging are

  • Help regarding accessing duplicate rows in a procedure

    Hi All, I have duplaicate records in my table. In my procedure, I have to access only one row and leave the remaining rows unprocessed. For ex:- EMPNO ENAME DEPTNO DNAME SAL 1128 SMITH 140 MARKT 200 1128 SMITH 140 MARKT 400 1128 SMITH 140 MARKT 600 1