ORDER BY for the result of a UNION?

I have two SELECT statements which are merged by a UNION ALL.
Ok, I could add an ORDER BY to each of the SELECTs but that would sort only the partial result lists.
How can I sort the whole result table (after the merge)?
Peter

putting the order by at the end of the last query.
SQL> select ename, sal from emp where sal>2000
  2  union all
  3  select ename, sal from emp where deptno=10;
ENAME             SAL
JONES            2975
BLAKE            2850
CLARK            2450
SCOTT            3000
KING             5000
FORD             3000
CLARK            2450
KING             5000
MILLER           1300
9 rows selected.
SQL> select ename, sal from emp where sal>2000
  2  union all
  3  select ename, sal from emp where deptno=10
  4  order by 2;
ENAME             SAL
MILLER           1300
CLARK            2450
CLARK            2450
BLAKE            2850
JONES            2975
SCOTT            3000
FORD             3000
KING             5000
KING             5000
9 rows selected.Max
[My Italian Oracle blog| http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

Similar Messages

  • Internal Order Report - For the documnets when the cost ele. was not create

    Hi,
    We created internal orders for tracking capital expenditure relating to assets. At that time, we were not created asset GL's as cost element. Recently we created asset GL's as cost elements (category 90).
    Now we are getting the internal order report after creation of cost element for the transactions done thereafter. We mentioned the internal order number in PO but not in accounting document earlier. Now we are maintaining internal order number in accounting document also.
    So when we run OKBA we are getting CO document but, it is not tracking against internal order (since order number was not mentioned earlier). We executed one MM document in which internal order was mentioned through OKBB but there is no change in the internal order report.
    Is there any possibility to get the internal order report for the transactions done before creation of cost element.
    Please guide me
    Best Regards
    Madhusekhar Gupta G

    Hi,
    Thanks for your quick replies.
    Can we get the report as follows.
    1. Total Po's value for the internal Order (through Table EKKN)                                                      xxx
    Less: Value already posted to Internal order after creation of cost elements (S_alr_87013019)  xxx
    Less: Total Value to be invoiced (Tcode -ME2N)                                                                             xxx
    Net amount to be posted to Internal Order manually                                                                        xxx
    Is it correct?
    Regards
    Madhusekhar Gupta G
    Edited by: gms gupta on Feb 20, 2012 4:33 PM

  • There was no way to order AppleCare for the iPhone 5 using the online AppleStore to have it activated automatically. Am I missing something?

    There was no way to order AppleCare for the iPhone 5 using the online AppleStore to have it activated automatically. Am I missing something?

    I must have missed the option to add AppleCare+ to my iPhone 5 pre-order, too.  Fortunately, I was able to obtain confirmation from an Apple representative that AppleCare+ can still be added to a new iPhone 5 within 30 days of the device's ship date.
    My iPhone 5 Ordering Situation:
    Successfully submitted pre-order at 2:05am CST
    Realized I did not add AppleCare+
    Tried to add it as a separate product
    Unable to add AppleCare+ after submiting pre-order
    This Morning:
    I just got off the phone with an Apple representative.  He assured me that, once my iPhone 5 arrives on September 21, I will be able to: 1) call 1-800-MY-APPLE and have AppleCare+ added to my iPhone 5;  2) go into an Apple Retail Store and have AppleCare+ added to my iPhone 5.  He said I would have thirty days from my device's ship date (September 21) to add AppleCare+ to it.  He also recommended that, if I wanted to have AppleCare+ added at an Apple Retail Store, I should make an appointment as soon as possible.  Because I was still concerned something might go wrong, the Apple representative emailed me a copy of my case number to use as a reference in case I have any issues obtaining AppleCare+ on September 21.
    Caveats & More Information:
    I ordered through the Apple Store app on my iPhone 4
    I live in the United States
    My carrier is AT&T
    I have a case number and repeated assurances from an Apple representative
    While your situation may differ from mine I do hope you're able to add AppleCare+ to your iPhone 5 once it arrives, either by calling 1-800-MY-APPLE or by making an appointment at your nearest Apple Retail Store.
    Best Wishes,
    Dylan

  • I am missing "other" as a target for the result state

    Hi,
    I am trying to implement a quite complex scenario using guided procedure design time.
    I am not able to find “other” as a target for the result state of a callable object (the system proposes me just the sequential action or termination, nothing more, so I am not able to change my flow as I would like).
    My portal is NW04s SP10.
    I fount that target (other) using a portal sp11, so I suppose that it could be a problem concerning sp10 release, but I was not able to find a confirmation for that
    Regards
    Giuseppe

    Hi Giuseppe,
    If I have well understood you’re trying to call in result state an action that is not in your current block.
    To do this you have to install SP11 and the “other” will appear as possible choice in the result state target.
    Regards
    alessio

  • Internal table for the result area

    hey
    where do the result area data stored in after the search? is it in internal table??. If so is there any possibility of finding the internal table?
    thanks in advance

    Hi Shailaja,
    You can check as pointed by Vijay, which is at the Framework Level.
    For Application Level (specific to your PCUI Appl), the QEURY method of your class (assigned to Search Area screen) returns the list of found object keys (based on the search query) to the READ method. The READ method now queries the backend, for the supplied object keys and stores all the result data in export parameter ET_SCREEN_SRTUCTURE.
    Now the Framework with the help of One Order Interaction Layer, pumps the data to the Data Context Layer as pointed by Vijay.
    So in order to do any data massaging, you can do it at internal table et_screen_structure.
    But whatever changes you do in et_screen_structure, will not be commited to backend, without touching the MODIFY method.
    Thanks
    Harsh

  • How to Find Out The Production Order Number For The Sales Order Line Items

    Hi All,
    I want to know the number of production orders for each sales order line item. I know the sales order number .Can anyone tell me how the tables can be linked to get all the production order numbers for each sales order line item.

    I think it depends on your configuration. But check fields KDAUF and KDPOS in table AUFK.  or in table AFPO.
    Regards,
    Rich HEilman

  • How to restrict production order creation for the WBS

    Dear Gurus,
    Our client is is using PS & PP. So that as per current procedure material required for the particular project will be uploaded into the CJ20N i.e. it will be assigned to the network.
    So that on that basis production orders will be created with the transaction co10. But in this case there is no linking between the orders created & quantity required in the project.
    So is there any restriction that by using co10 we will be able to create the production order for the material which is enterd in to the wbs with not exceeding the quantity also.
    With Regards...
    Abhay

    Dear Abhi,
    But why do you require to create produciton order manually through co10?
    Any how you must running MRP in MD51 where in you will get your planned orders which you can convert to production orders!
    Thanks.

  • Automatic creation of PR from sales order (SO) for the materials compement

    Hi
    I would like to create un PR from a sales order , but only for the material component (defined on Tcod CS01)
    I already know how to create un automatic PR from SO By using the TAS post type
    But the problem is that this method create only a PR for the material in SO him self and not for his component "what I really want"
    I search every where in VOV6  and VOV7 but I didn't find what Iu2019m looking for
    Thanks in advance For your advices and help
    S.Ghafai

    hello
    did you have any idea about this problem?
    I want to create automatically an PR for the Component of the Production BOM on saving my sales order
    exp :
    Material component = 1010 Qte 2  and 1011 Qte 25
    Sales material = 10XX Qte 1
    In my PR created the materials must be 1010 Qte 2 & 1011 Qte 25
    I hope my question is more clear now
    thanks in advanve

  • Purchase order number for the Delivery

    How do we get the Purchase order number from a delivery.
    Hello all
    Say i have an Purchase order [EKKO] and from that i have created a delivery.[LIKS]
    In my output for the delivery, i need the preceeding document number for the delivery which is the PO number.
    How do i get the same. what table should i look in. I checked the VBFA table, but i am not able to get the same there...
    is there any table with which we can get this info.
    thanks and Regards,
    Gauravjit.

    No, it will be at the line item level because you can potentially combine several PO (or sales order) line items into one delivery.

  • Segregate internal ordered items from purch. order items for the i-pro user

    We want to know if there are any Oracle i-Procurement implementations that have segregated the internally ordered items via an Order Management sales order from items ordered on a PO (purchase order). We have considered three possible paths to purse. 1) Table of Contents: this seems to not work because you can only connect a Group at the Category level not item level, 2) Multiple responsibilities one for Inventory and one for drop ship: This is not acceptable to the user. 3) Requisition Template.
    We attempted to implement this by creating two i-Pro stores named Main and Inventory Only. Our design defined that these stores be associated with a catalog for each group of item. We interpreted that the "Include items without suppliers in this catalog" flag in the Catalog definition would select those items that are stockable. However, the logic behind this flag does not consider the item attributes/Sourcing Rules set at the ORG level. Our company has two Orgs named INV for inventory and DEV for our service organization. For stockable items the items are coded Inventory Sourced in the DEV item master and the sourcing assigment is linked to a sourcing rule which is internal (that is, get from INV org). The items are coded Supplier Sourced in the INV item master and the sourcing rule is a Blanket. Thus, our inventory items were not included in the the catalog even though they were sourced internally at the DEV org because of the blanket sourcing rule in the INV org.
    Thank you, Ned

    Meera,
    Which version of SBO are you using 2005 or 2007?
    I don't think Serial numbers can help in this scenario.  There is no hard allocation or blocking possible using Serial numbers.
    This is the Work around I am thinking about.
    Set the items to be Batch Managed - On Every Transaction
    When performing Goods Receipt, enter the Sales Order Number as the Batch Number
    When creating the delivery, using SBO_SP_TransactionNotification we can easily check the Batch of the Item being selected and verify it with the BaseRef of Delivery lines to match with Sales Order number.
    If the numbers don't match we can warn user with message, "The items batch reserved for Sales Order xyz"
    Even if you make a mistake when entering the batch number same as Sales Order number when doing a goods receipt. It can still be traced and blocked during delivery.
    Hint: The Batch table records the Goods Receipt transaction along with the BaseDocument number, Base Ref, etc
    If you decide to go this route, I could help you further.
    Let me know
    Suda

  • When I do a search for a particular song in the iTunes store, how can I change the view for the results?

    I have the latest version of iTunes.  Today I did a search for a particular song.  In the past, I used to get a list of the song and the various artists who recorded it, and I could click the little arrow and play a preview of that song before I decided to buy it.  Today the results didn't display that way - instead, I got a page with probably 50 or 100 songs all spread out across the page, and the "writing" was all overlayed so you couldn't quite tell what you're supposed to see!  I want to go back to the "list" view but couldn't find anywhere to change the view preference.  Any idea how?

    Do a malware check with some malware scan programs.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of the database before doing a scan.<br />
    * http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    * http://www.superantispyware.com/ - SuperAntispyware
    * http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    * http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    * http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also "Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked and [[Searches are redirected to another site]]
    There are other things that need attention:
    Your above posted system details show outdated plugin(s) with known security and stability risks that you should update.
    *Next Generation Java Plug-in 1.6.0_16 for Mozilla browsers
    Update the [[Java]] plugin to the latest version.
    *http://www.oracle.com/technetwork/java/javase/downloads/index.html (Java Platform: Download JRE)

  • How can i display units only for the result set

    hi
    i do not want to display units (example: $ or %) for my key figure columns but i want to display units to the result.
    how can i do that

    Hi Surya,
    I don't think it is possible to have both non-unit and unit in the same kf.
    One potential workaround to do this is to create a calculated key figure/ formula that use the NODIM function for single values. Example: NODIM(0AMOUNT). Then, create a calculated key figure/formula that computes overall result on the same kf and supresses individual values but does not use NODIM....perhaps this can help you work out a solution.
    Hope this helps.
    Regards,
    Petter
    Message was edited by: M Petter

  • How to group order & AR for the customers under one customer hierarchy

    There are serveral customers under one customer hierarchy, we could easily get the group value in COPA (KE30) via
    the "customer hierarchy" parameter in the navigation channel. Could we also get the group value towards the incoming sales
    order and Account Receivable? Thanks for the suggestion...

    Hi,
    Please check "FDM_COLL01". It is very useful report, you can drill down the report inside aswell.
    Rgds
    Murali. N

  • I called *611 to check mr order status for the Iphone 6 plus.  It said 'recieved and activated'.  can anyone tell me what that means?

    When i called *611 to check my order statud for my 6+ it said 'revieved and activated'
    Can anyone tell me what that means?

        Hello ElAnBr10! So sorry for any confusion over your order status. I would take that comment ("received and activated") to mean exactly as it sounds: The device was shipped, received and activated. In order to confirm that, I propose we take a detailed review. I've sent you a direct message as a follow up to your post. Please reply there!
    DionM_VZW
    Follow us on Twitter www.twitter.com/vzwsupport

  • Waiting for the results and when the results are available show them...

    I have an input page, where the user gives an input. When the user submits this input page, the input is submitted to the server side component which does its processing (which is a time consuming process)....till the results are available i need to show a message that the query is being processed and once the results are available i have to show the results. How do i implement this? How will the page come to know when the query is processed and the results are available? please help..

    j2eeprofessional wrote:
    I have an input page, where the user gives an input. When the user submits this input page, the input is submitted to the server side component which does its processing (which is a time consuming process)....till the results are available i need to show a message that the query is being processed and once the results are available i have to show the results. How do i implement this? How will the page come to know when the query is processed and the results are available? please help..Following is the URL for ajax support.
    [ http://livedemo.exadel.com/richfaces-demo/richfaces/status.jsf?c=status&tab=usage|http://livedemo.exadel.com/richfaces-demo/richfaces/status.jsf?c=status&tab=usage]

Maybe you are looking for

  • Why mozilla.cfg file is not working with Firefox 21

    <pre><nowiki>//@line 2 "e:\builds\moz2_slave\rel-m-rel-w32-bld\build\browser\app\profile\channel-prefs.js" user_pref("browser.startup.homepage","https://www.mytest.com"); lockpref("browser.shell.checkDefaultBrowser", false); lockpref("app.update.enab

  • How to change a hi res picture of fingers in a way that will make the fingerprints clear ?

    Hi, I need to transform hi resolution pictures of fingers in a way that will cause the fingerprints to stand out. The purpose of this is so I may count the number of ridges and furrows of each fingerprint. Many thank !! Eran

  • Would like to change my security questions since i don't know the answers

    i recently added a new gmail address, changed ITunes e-mail to new one, made a new password. have been getting prompts via the old address, but it will not accept the old password associated with that e-mail. can't get in. can't figure out how to exp

  • IOS 7 - Retracting the SMS Keyboard

    With iOS5 & 6, I could pull down the keyboard in the SMS app and the message thread would snap firmly at the bottom just below the most recent message, similar for example to tapping on an empty part of the screen in Whatsapp. With iOS7, the momentum

  • Alphanumeric number range of Rebate agreements

    Hi, Question on using u2018Alphanumericu2019 number range of Rebate agreements. We would like to use alphanumeric number range for our rebate agreements so that we can build certain logic such as year\customer\type for easy reporting & grouping. For