ORDER BY(SELECT ...) for what?

Hi, actually i'm preparing OCE - SQL exam...
but now when i expect no more BIG surprises for me in the sql world something appear that i have not seen before(jajajaja)...
what is the use of ORDER BY clause combining it with a SELECT statement?
example:
SQL> desc pruebas
Nombre
ID
NOMBRE
EMAIL
SQL> select * from pruebas
*2 order by (select nombre from pruebas where nombre like 'w%' and rownum <=1)*
Edited by: user586516 on Nov 15, 2008 7:05 PM

i aggre with Rob van Wijk that the provided example doesn't make sense.
But there are situations Where an "order by select" is useful:
Sometimes you have the restriction that a select must go against excatly one table, but the ordering should be done on a column in another table.
One example is programming with Oracle forms and wanting to put DML against a datablock which is based on one table.
A typical situation is you have a table with a suggorate foreign key and you you want to sort your query by the "business key" in the lookup table.
Example from HR-scheme:
SELECT EMPLOYEE_ID,
       LAST_NAME,
       DEPARTMENT_ID
  FROM EMPLOYEES Y
ORDER BY (SELECT DEPARTMENT_NAME
            FROM DEPARTMENTS X
           WHERE X.DEPARTMENT_ID=Y.DEPARTMENT_ID
         )hope this helps

Similar Messages

  • No 'order by' selection for cluster tables generates run-time

    Hi together,
    Basically I want to use a "select...order by" statement with table mhnd.
    Since mhnd is a cluster table you can not use "...order by".
    So, I use a select ... into table. I then sort this table and finally read it (index = 1)
    Unfortunatly this approach generates huge run-time.
    What can be done to minimize run-time?
    Thanks for any help

    Hi Gerd,
    Which cluster table you are using and what`s data you wanted? Maybe there are some FM to extract data from it.
    regards,
    Archer

  • AFS ARun: sales order not been selected for the allocation run.

    Hi,
    I am setting up the Purchase-to-Order (similar to Indiv PO item sales order) Process for SAP AFS.
    When doing the Allocation Run (trx J3AT) after Goods receipt of Sales order stock, I get an error that ARun terminated because no requirements were selected. The delivery check report (/AFS/LIEF_CHECK) indicates that the sales order has not been selected for the allocation run.
    For this process, I have set-up an Allocation type with
    1.     Requirement selection that does not exclude MTO/PTO orders
    2.     Set-up stock selection which includes physical stock type for MTO/PTO orders to the customer special stock MSKA with the segment KALAB.
    Can someone suggest what I may have missed?
    Regards,
    PD

    Hi Pankaj, I have same exact issue. How did you fix this ?
    Thanks,
    Mahesh

  • How do I change the size of the tools and the text for the menus in Photoshop?  I need a magnifying glass in order to make out what they are.

    How do I change the size of the tools and the text for the menus in Photoshop?  I need a magnifying glass in order to make out what they are.

    Okay, I've figured it out, so I'm going to answer my own question in hopes that it may help anyone else that would like to actually be able to see what they're doing when using Photoshop CC 2014 on a high resolution screen.
    1.  Open Photoshop.
    2.  Select Preferences from the Edit Menu, then select General.
    3.  Change the HUD Color Picker to Hue Strip (Medium).
    4.  Select Interface from the Preferences menu on the left side of the dialog box.
    5.  Change the UI Font Size to Large in the Text area of the Preferences dialog box.
    6.  Select Experimental Features from the Preferences menu on the left side of the dialog box.
    7.  Select Scale UI 200% for high-density displays (Windows only).
    8.  Click on OK, then Exit/Quit Photoshop.
    9.  Open Photoshop and everything should be readable.

  • When bookmarking a page, I can't get the complete list of bookmark folders to dropdown in order to select any folder in which to bookmark page. What do you set to get whole list of folders in Bookmarks to drop down?

    When bookmarking a page, I can't get the complete list of bookmark folders to drop down in order to select any folder in which to bookmark page. The 'Folder:' bar has 'Bookmarks Menu' showing. The arrow on the bar drops down 5 recent folders to which pages have been saved, but the pop down arrow to the right of the bar just opens to show the three categories and 'New Folder' button. What do you set to get whole list of folders in Bookmarks to drop down?

    To all, embarrassingly enough, I have discovered that I didn't know how to expand the three categories including 'Bookmarks Menu' in the 'Bookmark This Page' pop up interface. It was expanded by default on the initial Firefox opening and first page bookmark attempt. Next use it only showed categories. I clicked and double clicked the 'Bookmarks Menu' line, but failed to see the small, shaded triangle used to expand/collapse list. If it appears collapsed, just tap triangle at left of line to see all folders. It seems to open the same way after I do it for first time. Sorry for the inconvenience, and thanks for all the attempts to help.

  • Apple TV won't download movies anymore.  it says to go to store and check Purchase history, but everything seems to be in order.  Any idea what I am looking for to fix the problem and download movies again?

    My apple TV will no longer download movies.  It says to go to the Apple Store and check purchase history.  Everything seems to be in order.  Any idea what I am looking for?

    Okay - let's cut to the chase...
    If the Menu Bar (File, Edit... Help) shown in my screenshot below is not visible, use CTRL+B to display it. Then click on Help/Check for Updates. If one is available, you will be able to select it at this time.
    Note the item at the bottom of the list; About iTunes. Selecting that will show you which version of iTunes you are using.
    An alternative method to display the Menu Bar is click on the box in the top left of your iTunes window...

  • Process order %00000000001 has been selected for deletion

    Hi Guys,
    With the use of strategy type 86 (assem bly processing for process order) when creating the sales order it is giving the error
    Process order %00000000001 has been selected for deletion
    Message no. V1796
    According to process order will be created automatically with the order type PI04. Related setting for the order type Pi04 in the specified plant is done.
    Pls help.

    Solved..Change the customer number

  • I would like to order photochop cc - for 2014.  I was advised to use the educators discounted membership.  Could you please tell me what plan this is?  Thanks.

    I would like to order photoshop cc for 2014.  I was advised to use the educators discounted membership.  Could you please tell me what plan that would be?
    Thanks for your help.

    Start here https://creative.adobe.com/join/edu
    Education Plan https://creative.adobe.com/plans?plan=edu
    One Year Intro Price http://forums.adobe.com/thread/1448933?tstart=0
    http://www.adobe.com/products/creativecloud/students.edu.html
    http://www.adobe.com/education/students/student-eligibility-guide.edu.html
    ID Proof http://www.adobe.com/store/au_edu/academic_id.html

  • HT201359 I made a mistake on a purchase Order ID: MHD7Y799XQ for $3.99.  Please credit my AX card.  I do not what this service.  Thanks.

    March 25th, 2013
    To Whom it may concern:
    Please discontinue the service Order No. MHD77Y799XQ for $3.99.  I made a mistake on line.  I do not know what I even order.  If this oder is not not credited to my American Express account I will remove it from my accounnt.  I sorry for the mistake.
    Mario Teresi 

    We are all itunes users just like you.
    All purchases are final.  You can try contacting itunes support and asking for an exception.

  • What exactly does "convert [video] selection for iphone" do?

    I have a lot of video, both movies and tv shows, that I've used ffmpegx to convert (usually from .avi) to an AppleTV preset in h264. As it stands, iTunes won't allow me to put them on the 3G. (I know some people have had problems with putting h264 on their 2.0 firmware phones, but this question is a little different.) If I tell iTunes to convert the selection for me, what happens? Does it duplicate the video in two resolutions? Will it reduce the resolution and make the video look worse on my AppleTV? Or is it completely harmless?
    Also, is there any reliable way to convert video in a batch, perhaps with a third-party program? It's pretty obnoxious that you can only convert one video at a time, slowly, with iTunes.

    The iPhone can play these formats:
    H.264 video, up to 1.5 Mbps, 640 by 480 pixels, 30 frames per second, Low-Complexity version of the H.264 Baseline Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; H.264 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Baseline Profile up to Level 3.0 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats.
    What ever you do its going to take a long time to convert a large library. Which is why I recommend the Turbo.264. I'm converting a full length movie to iPhone format at 48fps as I write this. Also because the Turbo takes the strain off the Mac I can carry on using my computer with no problems.

  • Setting up iPad, don't know what to select for security; WEP, WPA, WPA2, WPA Enterprise or WPA2 Enterprise.  We have service through Charter cable.

    Setting up iPad, don't know what to select for security; WEP, WPA, WPA2, WPA Enterprise or WPA2 Enterprise.  We have service through Charter cable.
    Thanks for your help!

    Choose the strongest security available on your router, preferably WPA2 using AES encryption and a long complex passphrase with at least 14 characters (the maximum is 63 characters).

  • How BOM and routing is selected for Planned order and Production order?

    Hi,
    Can any1 plz tell me how BOM and routing is selected for a planned order and production order. ?

    Hello Mathisuthan,
    BOM and Routing selection for the planned order and production order through production version, If u have more than one BOM and more than one Routing then u can maintain this information as Production Version in the system.
    Production version you maintained
    MM01/MM02 -- MRP4--- Production version
    Or you can create Production Versions in Mass also with Transaction Code "C223"
    In the case no production version maintained/created  for the material, then system by default  will pick the first BOM and routing.
    I hope this information helpful to you.
    Regards
    Umesh Mali

  • I just paid for and downloaded the wrong version of Adobe Acrobat X Pro. I downloaded the Microsoft version and I have a Mac running OX Yosemite. How do I get a credit for what I ordered and then reorder the correct Mac version of Adobe Acrobat X Pro

    I just paid for and downloaded the wrong version of Adobe Acrobat X Pro. I downloaded the Microsoft version and I have a Mac running OX Yosemite. How do I get a credit for what I ordered and then reorder the correct Mac version of Adobe Acrobat X Pro

    If you ordered Acrobat via subscription, then you can use either Windows or Mac version.  Just download/install the Mac version, then activate it with your Adobe ID.
    If you purchased the perpetual license, then you need to Contact Customer Care bu chat or phone.

  • Subject: Tabs - Show tab previews in the Windows taskbar. For what ever reason, this option doesn't show up for me to select. Why, or was this feature moved or removed?

    I'm running FireFox 10 and I have Windows 7 Ultimate on my PC. I would like to have the ability to select an open tab from the Windows taskbar. For what ever reason, this option is not showing in the Tools - Options - Tabs window. So, I can't select it. Why? Has this feature been moved or removed?

    The "Show tab previews in the Windows taskbar" does not appear as an option. in Options - Tabs.
    I Toggled the browser.taskbar.previews to True in About:Config, but it made no difference.
    So, no go on either solution.
    I am running Windows Ultimate 64bit. I don't know if that makes a difference.

  • Need suggestions for what order to install software on new computer

    I have had an iMac (with Panther) for 3 1/2 years but have never made any major changes to it and plan to leave it as it is. We got a second computer yesterday, one of the last of the white iMacs, via an Apple reseller. It came with Tiger 10.4.6 installed with a Leopard 10.5 drop-in disc and an iLife 08 disk. I set up the new Mac so I have a web connection, but have not yet transferred any data from my back-up external hard-drive, nor have I attempted to install Leopard or iLife 08. I'm looking for recommendations for what order I should do these tasks. Or does it matter?
    That is, should I play around with Tiger for awhile (I've never used Tiger before), move all my data and confirm all is OK before adding Leopard?
    Or should I get Leopard on the computer right as the next step?
    Should iLife 08 be installed before or after Leopard? or is either order OK?
    Any suggestions that would be helpful to me?

    I concur with the others on going straight to Leopard. Then resolve any issues before installing non-Apple applications (or older Apple ones, for that matter).
    However, make sure ANY applications are Leopard-compatible before you install them.
    And note that the iLife '08 installer is for a 30-day trial installation (fully functional for those 30 days) after which it needs to be purchased.

Maybe you are looking for

  • Forms 4.5 Migration to Oracle Forms 10g

    Hi All, I want to know abt migration steps i.e. i 'm doing migration of Oracle Forms 4.5 to Oracle Forms 10g. Then existing forms is on Windows NT based environment and the database is Oracle 8. What is the better way to approach this issue? Whether,

  • Report export webi to excel with zero values in tables

    All, I export a report from Business Objects Infoview and it doesn't allow for showing data elements of graphs or data tables that correspond to zero value data. When I export my report the months with no data drop from the graphs and tables.  I woul

  • Characterstic variable with customerexit

    Hi, I have one customer exit variable requirement. requirement is like: If the user entry value( VAR1) is 'A' output from customer exit variable (CUSTVAR) is (1,6),If it's 'B' output is just 6. How can we achileve this? Thanks

  • How to lower my iMac

    Hi I have an Imac 27" pc with the original stand. the height is too high and I strain my neck looking up. Does anyone know if apple or some other company makes another stand or adapter, the i can mount to the pc. I do not  want to wall mount it using

  • Saved passwords in Firefox

    A recent upgrade of firefox  caused all the saved password to disappear. . Is any one has similar issue?