Sum of the order for a specific customer

I have a statement like this

SELECT Orders.OrderID, Order_Det.UnitPrice * Order_Det.Quantity *(1-Order_Det.Discount) AS Total

FROM orders INNER JOIN Order_Det

ON Orders.OrderID = Order_Det.OrderID

WHERE Orders.CustomerID = "VINET".

gives me

ORDERID TOTAL

--------------      ----------

10248 168

10248 98

10248 174

10274 344

10274 194,6

10295 121,6

10737 24

10737 115.8

10739 114

10739 126

now, I want to only show one total value for each orderID, what should I do?

You can ADD?

Try:

SELECT Orders.OrderID

, sum (Order_Det.UnitPrice * Order_Det.Quantity *(1-Order_Det.Discount)) AS Total

FROM orders INNER JOIN Order_Det

ON Orders.OrderID = Order_Det.OrderID

WHERE Orders.CustomerID = "VINET".

Orders.OrderID group;

Tags: Database

Similar Questions

  • Trying to download my newly purchased Adobe Photoshop elements 14, after clicking on int o 'my account' and 'My orders', the installation guide tells me to click on the order for more information on the product and which works fine as well. However the ne

    Trying to download my newly purchased Adobe Photoshop elements 14, after clicking on int o 'my account' and 'My orders', the installation guide tells me to click on the order for more information on the product and which works fine as well. However, the next step where I press the download button is not possible, because the download button is not there... What should do? Also when I press the "see the recent downloads" and the error message is displayed.

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

  • As a gesture of goodwill, we can help you with the upgrade for PSE 13. We ask you to place the order for Adobe Photoshop elements 13 upgrade and then provide you with the serial number of the full version for the same product against the new upgra

    I have RECIVED YEAR EMAIL FROM ADOBE AS: as gesture of goodwill, we can help you with the upgrade for PSE 13. We ask you to place the order for Adobe Photoshop elements 13 upgrade and then provide you with the serial number of the full version of the product, even against the new order of upgrade"IS this UPGRADE FREE AND CE WHO SHOULD DO, HOW can I HAVE THIS UPGRADE?

    HOW I CAN PLACE THE ORDER AND IS IT FREE?

  • ITunes cannot locate the music for a specific artist

    All my music does not appear on my computer and my itunes, except one of my artists. Their albums/songs appear in itunes, but they may not be located on my computer. It is the music of a single artist and two albums. It allows me to play the songs on my ipod, iphone and ipad, but when I try to play music on my computer, it displays an exclamation point and the custom find or play. What should I do?

    The exclamation point means that it cannot locate the files in the iTunes Media folder.

    Looking for a specific file in Spotlight. Since you know what an artist is missing, search for this artist, album or song using Spotlight. If it's on your computer, projector find. All the music files in iTunes should be in the music folder. Open the Finder, click go > go to folder and paste the following text:

    ~/Music/iTunes/iTunes Media/Music

    Or, if you think it has been moved out of the folder of music, just look in the iTunes Media folder. It could have been placed in the right folder

    ~/Music/iTunes/iTunes Media

    If you have a backup with Time Machine, you can also enter Time Machine and restore the file (assuming that she has been saved before he disappeared).

  • Optimize the order for cutting vinyl overlay objects

    Hello

    I'm looking for a script to optimize the cutting speed of vinyl.

    The script must be similar to the following, but it will sort the objects selected by the position on the origin of the page and not the height of the point of origin of the page, as it does now

    Arranging stacking order of top-down script

    David John Entwistle

    var thisDoc = activeDocument;

    get selected objects

    var selObj = thisDoc.selection;

    count selected objects

    var selObjCount = selObj.length;

    Sort the selected objects by their height at the origin of the page

    var byProperty = {function (prop)}

    return function(a,b) {}

    If (typeof a [prop] == 'number') {}

    return (a [prop] - b [prop]);

    } else {}

    Return ((un [prop] < b[prop])?-1: ((un [prop] > b[prop])? 1: 0));

    }

    };

    };

    var symbolsSorted = selObj.sort (byProperty ("top"));

    for each object in turn in the orderly selection, BringToFront

    for (i = selObjCount; I > 0; i--) {}

    var currObj = symbolsSorted [i-1];

    currObj.zOrder (ZOrderMethod.BRINGTOFRONT);

    }

    Redraw();

    Alert ("selected objects sorted =" + selObjCount);

    Any help is welcome

    Panagiotis

    OK its end and is not exactly what you want.

    There are probably better ways to do this.

    Measure the distance from the top right of the page at the top right of the pathitems

    then sorts them accordingly.

    var doc = app.activeDocument;
    var item = doc.pathItems;
    var newLayer = doc.layers.add();
    newLayer.name = "New Layer";
    
    var newL = doc.layers['New Layer'];
    var oldL = doc.layers['Layer 1'];
    
    var list = new Array();
    for(var i = 0; i < item.length; i++)
    {
        list.push(dist(item[i].geometricBounds[0]/2.834645,item[i].geometricBounds[1]/2.834645).toFixed(3));
        item[i].name = list[i];
    }
    list.sort(sort);
    list.reverse();
    for(var j = 0 ; j <  list.length; j++)
    {
        for(var k = 0; k < oldL.pathItems.length; k++)
        {
            if(oldL.pathItems[k].name == list[j])
            {
                oldL.pathItems[k].move(newL, ElementPlacement.INSIDE);
            }
        }
    }
    function sort(A,B){return (A - B);}
    function dist(A,B){return (Math.sqrt(A*A+B*B));}
    
  • How to change the order for table?

    I use oracle 10g 10.2.0.3.0

    I have a select statement
    SELECT /*+ leading v.Guest_Info v.Guest_Domain_Relation Guest_Address*/
    *
      FROM (SELECT 
             Cdr.Guest_Domain_Relation_Id,
             Ci.Guest_Id        
              FROM Guest_Info         Ci,
                   Guest_Domain_Relation Cdr
             WHERE Ci.Guest_Id = Cdr.Guest_Id) v,
           Guest_Address Ca
     WHERE v.Guest_Id = Ca.Guest_Id;
    and explain the Plan shows
    1     Plan hash value: 3785964411
    2      
    3     ---------------------------------------------------------------------------------------------------------
    4     | Id  | Operation                     | Name                    | Rows  | Bytes | Cost (%CPU)| Time     |
    5     ---------------------------------------------------------------------------------------------------------
    6     |   0 | SELECT STATEMENT              |                         |  1806 |   199K|     9  (23)| 00:00:01 |
    7     |*  1 |  HASH JOIN                    |                         |  1806 |   199K|     9  (23)| 00:00:01 |
    8     |   2 |   MERGE JOIN                  |                         |   482 | 48682 |     6  (17)| 00:00:01 |
    9     |   3 |    TABLE ACCESS BY INDEX ROWID| Guest_ADDRESS          |   919 | 87305 |     4   (0)| 00:00:01 |
    10     |   4 |     INDEX FULL SCAN           | XAK1Guest_ADDRESS      |   919 |       |     1   (0)| 00:00:01 |
    11     |*  5 |    SORT JOIN                  |                         |   482 |  2892 |     2  (50)| 00:00:01 |
    12     |   6 |     INDEX FULL SCAN           | XPKGuest_INFO          |   482 |  2892 |     1   (0)| 00:00:01 |
    13     |   7 |   VIEW                        | index$_join$_003        |  3493 | 41916 |     3   (0)| 00:00:01 |
    14     |*  8 |    HASH JOIN                  |                         |       |       |            |          |
    15     |   9 |     INDEX FAST FULL SCAN      | XAK1Guest_DOMAIN_Relation |  3493 | 41916 |     1   (0)| 00:00:01 |
    16     |  10 |     INDEX FAST FULL SCAN      | XPKGuest_DOMAIN_Relation  |  3493 | 41916 |     1   (0)| 00:00:01 |
    17     ---------------------------------------------------------------------------------------------------------
    18      
    19     Predicate Information (identified by operation id):
    20     ---------------------------------------------------
    21      
    Is there in any case, I have Guess_Domain_Relation table join firstly that the join to Guess_Address table of Guest_info?

    I tried a few ways to rewrite the query, but he's no luck

    Thank you

    Published by: Y.L on March 20, 2013 13:59

    Y.L wrote:
    And my another problem here... I don't know why my first clue didn't work...

    Probably the syntax. The main indicator uses parentheses, as

    /*+
    select /*+ leading(table1, table2) */ *
      from table1, table2
    */
    

    Remember that you must use the table alias name in tips for the identifier to be recognized

    You can also consider using the y indicator (if you must use a hint) for several tables - beware, it is MUCH easier to do worse performance with this suspicion using the order of the tables in the FROM clause in left to right

    /*+
    select /*+  ordered */ *
      from table1, table2, table3
    . . .
    */
    

    How I create index will affect how it works?

    How the index was created probably won't affect how it works. Indexes can be created using constraints and directly with the CREATE INDEX command. The creation of the index should not be as important as its defined characteristics: index type, columns, etc.

  • Captivate 5: hide the playback for a specific slide bar

    Is it possible to remove the bar reading and its controls to a specific slide to ensure that the user (after reading some information) necessarily must click on a button to go to the next slide?

    For example: I built a production in which the quiz questions appear at certain intervals. I don't want the user to skip the question slides and proceed just click on the Play button. I want that they to select an option and click on the Submit button, which then leads to the next slide. So is it possible to hide the PlayBar to these slides only?

    John

    Hello

    You have configured by action 'Enter' to the first Question slide hide PlayBar? So it makes sense that the action you set up 'Leaving' review slide (think you point to the slide of Score here?) is devastated when you re-enter the first slide of the question.

    Could you try to hide the bar just before reading the first Question slide, slide "output on" slide just before the first Question? I think it would work, since this slide will not visited again when you return to the first slide of the Question for review. In this case, the action triggered on leaving the Score slide has an effect. Did not try, am a rush, please obtain if it does not work.

    Lilybiri

  • I want to uninstall a toolbar that has been the result of the search for something specific

    Hello

    I want to uninstall a toolbar that has been the result of the search for printable piano music.
    I uninstalled the stuff accompanying this research but I can't get rid of the toolbar. Can I just download an another toolbar as C.NET or what?

    I have a Dell dimension 4700 desktop, XP and I have ' yet to learn through this forum help and everyone.

    Thank you

    Gina Davis

    Original title: how to uninstall toolbat Inbox

    (IE unknown version)

    Hello

    Tools are what bar you referring? That's a browser or another program?


    Method 1:
    Run this fixit to remove it completely.

    http://support.Microsoft.com/mats/Program_Install_and_Uninstall/

    Method 2:
    You can uninstall the toolbar by following the steps below:
    a. open your Internet browser.
    b. click on 'Tools' then 'Add-ons' in IE; Click on "Tools" and "Manage Add-ons."
    c. find the add-on "Toolbar" in the list of available modules.
    d. remove the add-on toolbar in Internet Explorer, select the toolbar and click "disable".
    If you want to remove the toolbar, you can do this by uninstalling it in Add or remove programs.


    Also visit these links to learn more:
    http://TechNet.Microsoft.com/en-us/magazine/dd364987.aspx
  • Only read access to the ACS for a specific group

    All the

    I use an ACS with version (5.5.0.46.8). There is a group within the company requesting access RO to GBA.

    This group is already created in the user and groups of banks of identities/EXTERNAL/AD/directory

    In all of the elements/device/order Admin policy, I already have a set of SHOW command created

    I have looked in policies/Acess Network Services access authorization / Default / access but am a little lost after that.

    Please inform promptly.

    Looks like 'show' and 'sh' problem in the command set.

    If you pass for full access with it. It work?

    Remove 'sh' him then use some commands specific complete show.

    Let me know the results!

  • supported versions of the plugin for a specific vRO release

    Hi all

    I am struggling to identify what are all the versions of the plugin versions supported by a vRealize Orchestrator release specific or what are the vRealize Orchestrator release supported by a specific plugin.

    If we take as example one of the vRealize Orchestrator releases: 5.5.2 there is not anywhere in the release notes where I can see what versions of the plugin are supported by the latter: VMware vCenter Orchestrator Release Notes

    I can see the plugin versions it brings by default, but how do I know if all the other versions of plugins I currently use will work?

    Apart from that, if we now look at the release of one of the plugins vRO notes: VMware vCenter Orchestrator plug-in for vCloud Center Automation - Release Notes , I can see the following:

    VMware vCenter Orchestrator plug-ins for vCloud Automation Center 6.1 | September 9, 2014 | Generation 2073620

    VMware vCenter Orchestrator 5.5.2 | September 9, 2014 | Generation 1951762


    This means that this particular plugin version is only supported by vRO 5.5.2 when used in conjunction with vCAC 6.1? If the incompatibility of these versions he only is not supported?

    As you can see, it's making my head... so any info you can share with me would be great.

    Thanks in advance.


    Generally, we try to keep the plug-ins compatible across multiple versions of vRO. But this is not always possible; for example, a plugin could use a library to communicate with external systems and the library could be linked to a particular version.

    We have a platform internal vRO <->plugin version interop table but as far as I KNOW, he is not yet available to the public.

  • How the privilege for a specific function?

    Hi all

    I wonder if there is a privilege, that I could allow a user to perform a specific function.

    I tried to dba_sys_privs something about this but nothing returned.

    13:38:10 brunos@fastora1 > select * from dba_sys_privs where the privilege as "FUNCTION % ';

    DEALER PRIVILEGE ADMIN_OPTION
    ------------------------------ ---------------------------------------- ------------



    You guys have an idea for my problem?

    Thanks in advance.

    BSalesRashid wrote:
    Hi all

    I wonder if there is a privilege, that I could allow a user to perform a specific function.

    I tried to dba_sys_privs something about this but nothing returned.

    13:38:10 brunos@fastora1 > select * from dba_sys_privs where the privilege as "FUNCTION % ';

    DEALER PRIVILEGE ADMIN_OPTION
    ------------------------------ ---------------------------------------- ------------

    You guys have an idea for my problem?

    Thanks in advance.

    GRANT EXECUTE ON SPECIFIC_FUNCTION TO NEWBIE_USER;

  • I would replace the useragent for a specific site.

    I have the preference general.useragent.site_specific_overrides set to true and I general.useragent.override. [Web site] .com to my string of the user agent of your choice. However, this setting has no effect.

    However, I am able to get a global replace changing the general.useragent.override preference

    Also no luck with the global preference of compensation and leaving only specific site preferences.

    Is there something that I am missing? This procedure works on desktop firefox versions.

    I upgraded to Aurora 22.02 has and the issue seems to have been resolved.

  • The format for a specific Web site is displayed wrong, but it works fine in other browsers and Firefox's private browsing mode. What gives?

    Instead of having the sidebar on the left, I have the sidebar on the right and a big empty space where the text should be. The text is moved to the bottom of the empty space for me. I tried the cookies/cache forces the reload and total emptying, and I am sure that no change of format for manual Web site have been brought. I can see the site very well in other browsers and even in private browsing mode, so I have no idea why it is like that for me. Any help?

    Could you have zoomed in/out on this page? Go view-> Zoom-> Reset (or press Ctrl + 0 [zero])

    That solve it?

  • Creation of the invoice for a specific provider number

    When the user tries to create an invoice from a supplier, it is able to query the name of the provider, the site. But arriving at the date of the invoice the system not allow him to move.

    There is no error message.

    Grateful if someone can identify me with a workaround or a solution.

    Workaround solution - (disable this provider and then create a new.) However it will have an impact if there are unpaid invoices for the supplier, etc.)

    Thank you

    I hope that you have already checked if this provider is located in an active or inactive state.

    You can create a new provider & you can use the provider merge feature to merge existing provider to the new provider.

  • Download the schema for a specific object.

    I need to get for a scheme name 'table' so that I can get its underlying meta data information. A user gives me the name of 'table', but the 'picture' could be in my schema, or could a synonym pointing to another schema. I need to be able to do the following:

    Select COLUMN_NAME, DATA_TYPE, NULLABLE from all_tab_columns where table_name = passedTable and owner = TableOwner

    But the calling program doesn't know (and spend) so I need to understand what the true owner/table is the name of "table".

    What I nee is something similar to the 'who' unix/linux command.

    Paul

    You can use dbms_utility.name_resolve.

    This procedure resolves the given name, including the translation of synonym and
    authorization control if necessary.

    Syntax

    DBMS_UTILITY.NAME_RESOLVE (
       name IN VARCHAR2,
       context IN NUMBER,
       schema OUT VARCHAR2,
       part1 OUT VARCHAR2,
       part2 OUT VARCHAR2,
       dblink OUT VARCHAR2,
       part1_type OUT NUMBER,
       object_number OUT NUMBER);
    

Maybe you are looking for