SQL question to get a top customer of the page

Hi all
I'm prasanna. I have a question about SQL, to get a customer based on name of the year and the customer. I wrote the request like this. But I got an error.

Select calendar_year, cust_first_name, max (sum (amount_sold)) in sale, the time the customers where sales.cust_id = customers.cust_id and times.time_id = sales.time_id of the calendar_year group, cust_first_name

The error is like this:

* Error from the 1 in the command line:
Select calendar_year, cust_first_name, max (sum (amount_sold)) in sale, the time the customers where sales.cust_id = customers.cust_id and times.time_id = sales.time_id of the calendar_year group, cust_first_name
Error in the command line: 1 column: 7
Error report:
SQL error: ORA-00937: not a function of simple-group
00937 00000 - 'not a single-group function. "
* Cause:
Action:

Thank you inadvace
Kind regards
Prasanna

865016 wrote:
Your response, I had only one top customer with year, name of the client, amount_sold. But I need for each year

select  calendar_year,
        cust_first_name,
        total_amount_sold max_amount_sold
  from  (
         select  calendar_year,
                 cust_first_name,
                 sum(amount_sold) total_amount_sold,
                 row_number() over(partition by calendar_year order by sum(amount_sold) desc) rn
           from  sales,
                 times,
                 customers
           where sales.cust_id=customers.cust_id
             and times.time_id=sales.time_id
           group by calendar_year,
                 cust_first_name
        )
  where rn = 1
/ 

I will give you a single customer by calendar_year.

SY.

Tags: Database

Similar Questions

  • I have a problem connecting on ebay if you use firefox, I get a message saying that the page does not not despite having cleared my cache and cookies.

    I have a problem connecting on ebay when you use firefox, it has been fine for years, but since a few days, I get a message saying that the page does not when I try to log in. I tried to clear my cookies and cache, but it makes no difference. This does not occur in google chrome and I can log on fine there so what's the problem with firefox?

    Do you also have this problem if you temporarily switch to private browsing mode?

    • Tools > Options > privacy, choose the setting Firefox will: use the custom settings for the story of
    • Select: [X] 'always use private browsing mode '.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > appearance/themes).

    See also:

  • How can I go back to the bar of reminder of password rather that the notification that I now get that obscures some of the page

    The notifcation ' do you want Firefox to remember the password for... on appeared as a horizontal bar at the top of the page, under the tabs.
    It covers a part of the top left of the page as a sort of 'call-out '. I want to remember the passwords for some sites and continue to see the reminder, but I don't want that to hide part of the page. It's worse in my netbook because the screen is relatively small, so the proportion of the hidden page is relatively high. In which version has it changed? How can I get the password reminder to return to a horizontal bar in Firefox v9?

    You can close and reopen that don't forget to pop up password at any time by clicking on the icon key on the address bar if it is troublesome.

  • When you want to reduce two web page options are available in the top right of the page:

    Options to reduce the size of a web page are offered via signs place and dashboard at the top right of the page.
    In my case, that the place does not - it just let page to the original format. My only option is to use the dashboard which reduces the page at least - an icon in the taskbar.

    The icon in the Middle toggle between maximized and resizable. When the window is resizable, you can click and drag upward from the lower right to resize the window.

  • the sign less, shrink, & out the buttons at the top right of the page is missing? How to make a comeback. In their place, it is only black?

    the sign less, shrink, & out the buttons at the top right of the page is missing? How to make a comeback. In their place, it is only black? I can click where I know everyone is & it works, but I need to be able to see them. Thanks for your help.


  • How to get MG7520 printer to print the page number

    How to get a MG7520 printer to print the page number on the paper

    Hello.

    Printers do not have the ability to print a page number of your document.  This will have to be enabled through your software or document settings.  Check if your document has the possibility of having a page printed on each page number.

    It has not responded to your question or problem? Find more help contact us.

  • How to position spry ToolTip with a div instead of the top left of the page

    I changed the java script to a spry leading position of tool in the top left of my page.  I need to be placed in a position defined by the top left of a div instead, so it always appears in the same place regardless of the size of the screen or browser.  Any ideas?  That's what I changed to get the default value of positioning of the cursor position:

    Change SpryTooltip.js line 211:

    From:

    Spry.Widget.Utils.putElementAt (this.tooltipElement, this.pos, {x: this.offsetX, y: this.offsetY}, true);

    TO:

    Spry.Widget.Utils.putElementAt (this.tooltipElement, {x: this.offsetX, y: this.offsetY}, true);

    This does not take into account the position of the mouse and uses only shifts to set the fixed position...

    Here is a link to what I'm working on.  The forklift upper center is the element that so far, I've built that has the ToolTip overview.

    http://fallswayrents.com/indexHover.html

    Thank you!  Mike

    Line 65 of the HTML:

    $('.tooltip').hover (function () {}

    who to change:

    {$('.tooltip__#topcenter__').hover (function ()}

    As all the info-bubbles-containers have a class .tooltip, the previous code displays the 2 other ToolTips too since we did not have a defined tag.

  • How to make the top sites page appears when I open a new tab? Why have I not of "buttons" to pin a top site of the page tab?

    When I open a new tab, NO best sites don't show up... shows just a search engine box. I have Firefox 33.0. Why is there no 'pin' button when I opened a new page? How to make the top sites page appears when I open a new tab?

    Here is some additional information on the configuration of the new tab page:

    (1) in a new tab, type or paste Subject: config in the address bar and press ENTER. Click on the button promising to be careful.

    (2) in the search above the list box, type or paste newtab and make a pause so that the list is filtered

    (3) double-click the preference browser.newtab.url and enter your favorite page:

    • (Default) page thumbnails = > subject: newtab
    • Blank tab = > subject: empty
    • Built-in Firefox homepage = > topic: welcome
    • Any other page = > full URL of the page

    Press Ctrl + t to open a new tab and check that it worked. Fixed?

    Some traps:

    If Firefox will not let you change this setting: you can have what is called SearchProtect on your system.

    Firefox if allows you to save your changes, but he doesn't know: one of your extensions may be the substitution of her. You can consult, disable and/or remove extensions on the addons page:

    "3-bar" menu button (or tools) > Add-ons > in the left column click on Extensions

    If the modification works during your session, but during the next startup is leads to: you could have a user.js file in your personal settings Firefox (your Firefox profile folder). This article describes how to track down and delete the file: How to fix preferences that will not save.

    A little luck?

  • Why don't the bars of links or search on the top half of the page does not work on any site when I use firefox but work fine in Internet Explorer?

    links and bars research on top of half of the pages do not work and is not that I click on them and they don't work, but it won't let me click on it it's like he doesn't see the

    Recently, the Yahoo toolbar and the extension of Babylon have been reported because of this problem. They appear to overlap invisibly on the top of the display of the web page. If you have one or both, uninstall or disable them/it or see if an update is available that solves the problem.

    If this does not resolve the problem:

    If this answer solved your problem, please click 'Solved It' next to this response when connected to the forum.

  • Safari will not open a Web site, open to all others. I checked with chase, the site that I can not open, they said that their system works. I closed the computer. The message I get is "" Safari cannot open the page because the unexpected server ""

    I have a mac-mini end 2012, OSX El Capitan 10.11.3, 2.5 GHZ intel core i5, 116 GB 1600 MHZ, DDR3

    When I connect to my Chase account using 1Password, I get the message "Safari cannot open the page because the server has quit unexpectedly the connection, try again later".

    I called Chase, their system is working normally. I rebooted the computer twice, I have tried for 3 days now.

    I went to Safari/Preferences, deleted cookies etc. All to nothing does not.

    Ideas?

    Have you signed up with before Safari?

  • When I click on the windows media player, I get a message saying that the page is not found or no longer exists. Why is this

    When I click on windows media player, I get the message, the page you requested could not be found or no longer exists.  Yet, I cannot go into the library for the albums, I copied on media and it opens when I put in a USB stick etc to see the pictures in the media player.  Can someone help please.  I am running Windows Vista Premium Homwe.

    Hello

    You did changes to the computer before the show?

    Method 1: Check the protocol settings and proxy such as mentioned in the article below, and then try to use the functionality of online stores and a Media Guide.

    What protocols use Windows Media Player for streaming?: http://Windows.Microsoft.com/en-us/Windows-Vista/which-protocols-does-Windows-Media-Player-use-for-streaming 

    Method 2: If the problem is uninstall and reinstall Windows Media Player.

    Step 1: Uninstall Windows Media Player:

    a. go to Start and in the search type "or turn off Windows features turn on."

    b. click on "turn Windows features on or off". ""

    c. find multimedia and uncheck the brand in front of Windows Media Player.

    d. restart the computer

    Step 2: Reinstall Windows Media Player:

    a. go to Start and in the search type "turn Windows features on or off". "

    b. click on "turn Windows features on or off". ""

    c. find the multimedia functions, and then place a check mark in front of Windows Media Player.

    d. restart the computer.

    For more information, see the article below:

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-Windows-features-on-or-off

  • The size of the pie gets smaller when I send the page

    Hello

    I have a

    1 Shuttle

    Table 2 columns

    3 and Camembert

    on the same page, the histogram is driven by the values that are selected on the shuttle and when I select anything from the shuttle to the right side of the page is submitted. Now the pie chart is also redrawn according to the value selected in the shuttle.

    But pie gets smaller when there are more 3-4, selected items on the shuttle.

    I don't know how to keep the size of the pie chart.

    Advanced thank you for your help.

    Thank you

    Rakesh

    If the area gets smaller you can try adding: style = "width: 700px;" or something similar for the attributes of the region.

    If you are referring to the actual piechart try remove the tags / values of the attributes of table and see if it helps. It could be that adding labels more will decrease the size to accommodate for the printing of labels.

    I have

  • How to lock the top items on the page?

    Hello world

    I am a new user (in trial version) to Muse and despite the fact that I did the tutorial, I can't locked on the top of the page items where users scroll as in this page: Menu | Katie Bakery Café (Logo Katies + Menu and the second part also locked lunch/dinner...)

    Could you explain to me how can I do?

    I think the real problem is that I do not understand the difference between the top of the Page / header and the bottom of the page / footer...

    Could you explain that?

    Many thanks in advance and sorry for the misspelling: I'm just French

    Place an object where you want and PIN in this position by selecting its relative position in the band of higher order:

  • Trying to move an icon next to my top NAV of the page.

    www.bristolequestrianservices/stables.html

    I'm trying to move a FB icon next to my top nav page,

    Me I lowered the top nav and the div for the FB icon float to the right, disable both, why don't he's going to please.

    Thank you

    Hi Karen,.

    in my library, I found these tips css, based on the pages of the old SPRY menu:

    #MenuBar6 a {}

    background-color: #FC0;

    padding-left: 1.5em;

    }

    #MenuBar6 a: hover {}

    background-color: #FF0;

    Color: #F00;

    }

    #MenuBar6 a.MenuBarItemSubmenu {}

    background-image: url(images/star.gif);

    background-position: 5% 50%;

    }

    #MenuBar6 a.MenuBarItemSubmenuHover {}

    background-image: url(images/star-hover.gif);

    background-position: 5% 50%;

    background-color: #FF0;

    Color: #F00;

    }

    The gif, you'll find it here: and here: place of the star, you can unse your image of fb.

    Hans-Günter

  • Oracle PL SQL Question to get some data to oracle tables descrepancy

    Version of database

    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production
    PL/SQL Release 9.2.0.8.0 - Production
    CORE Production 9.2.0.8.0
    AMT for HP - UX: 9.2.0.8.0 - Production Version
    NLSRTL Version 9.2.0.8.0 - Production

    created a few sample data

    drop table tab1 purge;
    create table tab1 (DEPT_ID COMP, qc_subtype_id char (4), EQUIP_CODE varchar2 (20), create_time date);
    Insert into tab1 values(13,'1026','HEMORYA011',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA011',sysdate);
    Insert into tab1 values(95,'1026','HEMORYA121',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA121',sysdate);
    ----------------------
    Insert into tab1 values(13,'1026','HEMORYA014',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA005',sysdate);
    Insert into tab1 values(13,'1012','HEMORYA013',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA013',sysdate);
    Insert into tab1 values(95,'1012','HEMORYA148',sysdate);

    commit;

    I need to get a query to get the records of the gap

    Dept HEMORYA014 13 lack 1012

    HEMORYA005 dept 12 lack 1026

    Dept HEMORYA013 13 lack 1026

    The dept 95 lack 1026 HEMORYA013

    The dept 95 lack 1026 HEMORYA148

    I want to show the latter on the report

    Thanks in advance.

    Thanks for posting a unit test.
    I hope it will work for you, but maybe you will need to set the WHERE clause (add additional predicates).

    SQL> select equip_code
      2  from ( select equip_code
      3         ,      count(distinct qc_subtype_id)
      4         from   tab1
      5         group by equip_code
      6         having count(distinct qc_subtype_id)<2
      7        )
      8  order by equip_code;
    
    EQUIP_CODE
    --------------------
    HEMORYA005
    HEMORYA013
    HEMORYA014
    HEMORYA148
    

Maybe you are looking for

  • error DVD 69889 drive

    I tried to play a DVD using the DVD player application and got a black screen.  It gave me an error code 69889.  Help! I have OS 10.11.3

  • HP Officejet 8600 more print and scan problems

    Hello I had my HP officejet 8600 more for 2-3 years and always had problems following and just kept reinstalling the drivers as a quick fix. I am now starting a business from home and I have no time to deal with printing and scanning the questions an

  • C00F050 Windows update error installing KB977074

    I'm having problems when trying to install KB977074 update, firstly I click on install it downloads the update and asks me to restart the system, I try and it up to 30%, then restarts, then tent again gets up to 67% and then it restarts again then re

  • HP laptop PC 14 14-g008AU: restart sudden

    Hello.. I have a problem with my laptop here. My product is 14 Hp notebook pc 14-g008AU, 4 GB of RAM and windows 7 64-bit. Keep restarting my device whenever I play / watch movie to a dvd or a file (even if the film / video only a minute or two as a

  • Updates from Microsoft for Vista

    When Microsoft implemented to date are displayed for me to download in my Vista program... these updates take MB of space on my computer?