How to display single row column with nested group function

SQL> select deptno, Max(sum(sal)) SalSum
2 from emp
3 group by deptno;
select deptno, Max(sum(sal)) SalSum
ERROR at line 1:
ORA-00937: not a single-group group function
Can you please the Help me to get the Max(sum(sal)) with Deptno ......

select deptno, sum(sal) SalSum
from emp
group by deptno;The ablove query will give only one value for SALSUM for a department. So there is no meaning on applying MAX on this for a department..
What are you trying to achieve?
This?
select max(salsum) salsm,max(deptno) keep(dense_rank first order by salsum desc) deptno
from(
select deptno, sum(sal) SalSum
from emp
group by deptno);Edited by: jeneesh on Sep 4, 2012 6:00 PM

Similar Messages

  • How to display BLOB image column with WEB application, JSF, ADF BC

    I looking for a way to display the content from a blob column on a WEB application, JSF, ADF BC
    The blob column contains a JPEG image.
    About the application
    The model contains a viewobject where the blob column attribute (photoimg) type is of type : BlobDomain
    Now I have to create the view to display the content of photoimg inside a JSF-JSP page.
    Any advice ?

    Search is your friend
    How to display the content of a BLOB column in a ADF/BC pages ?
    John

  • How to display a different column based on group by result

    Hi,
    I am trying to write a efficient query for doing the following. Any inputs are highly appreciated.
    Consider the below table as an example with 3 columns: Col1,Col2 and Col3
    Col1     Col2     Col3    
    ABC     20        LM20
    ABC     26        M20 
    ABC     30        H20's
    ABC     24        M20's
    Now I need the query to return Col 3 which correspond to min and max of Col 2, i.e. "ABC     LM20(min of col2)     H20's(max of col2)"
    Its easy to write a group by statement to get the min and max. But I need the corresponding Col3 for the min and max. I dont want to do a self join on the same table since its a huge table. Is there any other way to do this?
    Thanks

    Have you considered the RANK function?
    select *
    from (select col1, col2, col3
                   ,rank () over (partition by col1
                                       order by col2 desc) hival
                   ,rank () over (partition by col1
                                       order by col2 ) loval
            from tab)

  • How to get a single row column from a viewobject in java?

    I have a class file that goes out and gets a viewobject and sets its where clause
    this is it:
    vcRow = vc.createViewCriteriaRow();
    vcRow.setAttribute("LogonId", "='" + strPcis_Login.toUpperCase() + "'");
    vc.addElement(vcRow);
    vo.applyViewCriteria(vc);
    vo.executeQuery();
    I know this working cause I can watch it in debug..
    but now the problem.
    I've looked in the docs and don't see how one can pull the value of the row it found and place it in a uix page in a textinput area
    how can I get a single row column, in this case the UserName that is in the view object to a string and then place it into my
    uix page? I've looked and looked and don't see a method for this.
    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented?

    is there a way to take the oracle.cabo.servlet.Page and set a textinput with a viewobject get method?
    what way do you do this and where is it documented? What you can do is get the value from your VO and set it somewhere that UIX can data bind to -- as a Page proprety, on HttpSession, etc. This is documented in Chapters 4 (Data Binding) and 5 (Controller) of the UIX Developer's Guide.
    To set a property, you use Page.setProperty(String key, String value). Then, in your UIX file, to make a textInput that has the value pulled from a given page property, use:
    <textInput data:text="key@ctrl:page" />
    -brian
    Team UIX

  • Error in nested group function used with column name.

    Hi Team,
    If i used nested group function with column name its not working. Could you please any one suggest me.
    How to use it.
    Regards,
    Venkat.
    Please find Spool ........
    SQL> select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name,CNT;
    select user_name,max(max(CNT)) from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    ERROR at line 1:
    ORA-00937: not a single-group group function
    SQL> select max(max(CNT)) from(select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    MAX(MAX(CNT))
    605

    Venkat wrote:
    Hi Sayan
    Its giving output like below, but not given maximum CNT.
    SQL> select user_name,max(CNT)from (select USER_NAME,count(*) CNT from v$open_cursor group by USER_NAME)
    2 group by user_name;
    USER_NAME MAX(CNT)
    BANES_LERG 6
    VENE_USER 8
    USER3 339
    DBUS 106
    VEL_USER 37
    SYS 597
    6 rows selected.Check it - Re: Error in nested group function used with column name.
    and previous post

  • Single row/column marquee tool "add to" not working

    I was trying to follow along with a tutorial that was using the single row/column marquee tool.  In it they used shift click to add to the selection.  It's not working for me.  I also tried clicking on the add to icon for the marquee tool, and it still doesn't work.  Does anyone know what the problem could be and how I might fix it?
    Thanks!

    hey i know this is late but if its any help now all u need to do i zoom in a lil closer the proceed with the selection. hope i helped. oh and u have to make sure your grid lines are perfectly on the 10,20,30,... percent mark and u have to be zoomed in if u want to see your lines. the problem is your file is too big and has somn to do with ur computer. its not only mac windows too.
    p.s. when ur done drawing the boxes u can zoom out...i know the tutorial

  • How to display first row value returened from a query as checked as default in a report

    How to display first row value returned from a query as checked as default in a report
    Example
    Parameter 1
    Paramerter2
    ABD
    x(checked)
    Test
    DEF
    JMG
    Mudassar

    Hi Mudassar,
    The issue is caused by the order in which the parameters appear in the report data tab can be difference between our report execution and it failing. In other words, “Parameter2” is execution before parameter “A” due to this issue. We can adjust the parameter’s
    order to solve the issue.
    If “Parameter2” is parameter “A”, we cannot use that expression. Because fields cannot be used in report parameter expression, if we want to display the first value returned from a query as default value, we have to fill the “Specify values” text box with
    the specific value in Default Values dialog box.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • How to print the row  ,column,and particular cell in separate color

    how to print the row  ,column,and particular cell in separate color IN ALV GRID

    HI,
    Here you go good program links
    <a href="http://www.sapfans.com/forums/viewtopic.php?t=52107">How to Set Color to a Cell in AVL</a>
    <a href="http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_color.htm">ALV Grid Coloring</a>
    Thanks
    Mahesh

  • How to set the screen size with nested Iview screen

    Can someone show me how to set the screen size with nested IView  screen.
    at the moment i only try it with trial and error untill it looks somewhat close. Is there a property in VC to set the size for Height and width.
    The same question is for the form. the form elements inside the form is easy but the actual form is still a challenge.

    Hi,
    Yes you are correct ,Still the Form and iview are not able to change thier Layout Structure using a Propery.
    it is available with VC7.1
    Govindu

  • How to display the message along with a value using BBP_CHECK_BADI

    Hi Gurus,
    I need to display a message dynamically when the user create's a shopping cart. I am using Check_badi for this. i.e., I need to display the buyer number and amount left for him dynamically. I am storing both of them in variables and don't know how to display the messages laong with some message " the amount left for <XXXXXX> is <$$$$$$$$>". Can you help me out.
    Thanks,
    Neelima

    Hi,
    you can use the function module 'BBP_PD_MSG_ADD'. This is the function module normally used for the displaying the error messages in SRM.
    See wether you can use already available error messages , use the transaction SE91 , and the message class being BBP_PD

  • How to display the selection screen with icons as well as with text element

    How to display the selection screen with icons as well as with texts (written in text elements) for PlantDate, OrderType,WareHouse..

    Report zex33.
    type-pools: icon.
    selection-screen begin of line.
    selection-screen comment 1(20) text_001.
    parameters: p_werks type marc-werks.
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_002.
    parameters: p_whouse(10).
    selection-screen end of line.
    selection-screen begin of line.
    selection-screen comment 1(20) text_003.
    parameters: p_auart like vbak-auart.
    selection-screen end of line.
    initialization.
      write ICON_PLANT  as icon to text_001.
    concatenate text_001 text-001 into text_001 separated by space.
      write ICON_WAREHOUSE  as icon to text_002.
    concatenate text_002 text-002 into text_002 separated by space.
      write ICON_ORDER  as icon to text_003.
    concatenate text_003 text-003 into text_003 separated by space.

  • How to display a BLOB column in ADF.

    How to display a BLOB column in ADF.

    hi agowlikar786
    Maybe the forum thread "ADF BC : download BLOB " can help
    at ADF BC : download BLOB
    regards
    Jan

  • Show row/column with empty dimension values.

    I have 2 columns where 1 column is dimension and 1 column is measure.  I need to hide the row when the dimension is empty.
    What I did is at the block I UN-TICK  "Show row/column with empty dimension values".  But it didnt works.
    Thanks.

    click on the block and add a filter with condition dimension isnotnull. this will eliminate the dimension rows with empty values.
    Thanks,
    karthik

  • How do I autofill a column with numbers increasing by 1?

    How do I autofill a column with numbers increasing by 1?

    Hi Patricia,
    Type in your first 2 values. Select both and drag the yellow dot down to fill the remainder.
    quinn

  • How to display alternate row colors in struts form?

    hi,
    I am using struts lib to display data in jsp page.
    <logic:iterate id="result" name="listofPorjetcts" indexId = "i">
    <tr>
    <td ><bean:write name="result" property="projectName"/></td>
    </tr>
    how to display alternaternate row colors ?
    any one can help?

    hey i not sure abt structs, what i did for jsp was using a boolean.
    declare boolean red=true;
    <tr
    <%
    if(red){%>
    class="red" >
    <%
    red=false;
    }else{%>
    class="white">
    <%
    red=true;
    %>
    take note that the class is a predefined css. I think u can use style="background-color:#red "
    You can seearch the web for more info.

Maybe you are looking for

  • Why is my 7th Generation Ipod Nano not placing music in the same album?

    But to be more specific. Let's say I've bought a music album from iTunes. All the music is in the same album. But there is this other song I've downloaded and I want to put it on that same album. On my ipod, for some reason, they are on separate albu

  • Unable to Edit DOCx file converted by ExportPDF - HELP!

    I am unable to edit a DOCx file that I created by converting a PDF file using the ExportPDF subscription. The file was originally created in Adobe InDesign.  I have the PDF.  I need to convert it to DOCx to edit the text.  The document is basically t

  • Db link - invalid username/password error

    hi i created a connected user public db link, when i try to use it i get error message invalid username/password here is my set up: tnsnames.ora --remote db DWHTEST= (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dwhtest.be)(PORT = 1521)) (CONNECT

  • Output Differences between 8.0.x and 8i

    It seems that SQLPLUS behaves differently (by version) when applying string functions to character columns. Has anyone noticed this? Am I missing a setting? We have just upgraded a database from 8.0.5 to 8.1.7 and have noticed the following behavior

  • Inbox Search:Locking Service Ticket Categories,Priority & Status for update

    Hello Gurus, If I create a Service Ticket and save it, I get the transaction number and then can search for the Service Ticket using either the Interaction History or the Inbox. If I search using the Interaction History, I get taken to the Interactio