Select "ordinate inline-view" - the output orders or not?

Request always generates data ordered by "T1.col3"?
select * from (select col1 from T1 where col2=10 order by Col3 desc ) where ROWNUM <= 5;
As you can see I ordered in line-view, then I select data from this view inline with external selection. It is ensured that the data is output now as he was ordered inside inline-wiew? Can watch tests that Yes, the data seem to be ordered as order is defined inline-notice. I understand inline-view is as something static snapshot, area, where the data are well classified, and if I now running on such thing an external "select * from"-clause, then he should get out of the well-ordered way, because I don't join what anyone or to do something else, I simply by selecting all the lines in one ordered in line-view. "» Am I right or not?

(Oracle 10g, Solaris OS)


---

The example data:
with T as
(select 1 as col1, 10 as col2, 106 as col3 from dual union all
select 5 as col1, 10 as col2, 100 as col3 from dual union all
select 6 as col1, 10 as col2, 104 as col3 from dual union all
select 3 as col1, 10 as col2, 101 as col3 from dual union all
select 4 as col1, 10 as col2, 105 as col3 from dual union all
select 2 as col1, 10 as col2, 103 as col3 from dual)
select * from (select col1 from T where col2=10 order by Col3 desc ) where ROWNUM <= 5;
Edited by: CharlesRoos the 10.12.2010 15:49

Hello

CharlesRoos wrote:
The following query always generates data by "T1.col3"?

select * from (select col1 from T1 where col2=10 order by Col3 desc ) where ROWNUM <= 5;

The output will contain the 5rows with 5 larger values for Col3.
These 5 rows not necessarily appears in order. Add an ORDER BY clause in the main query if you need ensure that.

Maybe it's that, on your version of Oracle and your platform, the main request happen to keep the agenda constantly. This is exactly the kind of thing that stops working when you move to another version or another platform. If you want the end result in good standing, to use an ORDER BY clause in the main query.

Tags: Database

Similar Questions

  • API to view the output/log of the concurrent requests

    Hi all:

    I use EBS 11.5.10 (DB: 10r2)

    Is there an API I can call to view the output/log of a concurrent request?

    We have the APEX Oracle installed in the same database as our EBS and I am developing a report of the APEX, where user provide a competing request id and then click a button; then APEX calls some Oracle EBS API to extract the output/log for this id of the request file and open it in the browser automatically (assuming that / natural log of output is the text).

    Thank you!

    Kevin

    Hey Kevin,

    Here is an example of a sqlplus session:

    Set serveroutput on 10000;

    SQL > declare
    number of v_request_id;
    v_two_task varchar2 (256);
    v_gwyuid varchar2 (256);
    v_url varchar2 (1024);
    Start
    v_request_id: = 123456; (request identification number)
    Select profile_option_value
    in v_gwyuid
    of fnd_profile_options o, fnd_profile_option_values ov
    where profile_option_name = 'GWYUID. '
    and o.application_id = ov.application_id
    and o.profile_option_id = ov.profile_option_id;
    Select profile_option_value
    in v_two_task
    of fnd_profile_options o, fnd_profile_option_values ov
    where profile_option_name = 'TWO_TASK.
    and o.application_id = ov.application_id
    and o.profile_option_id = ov.profile_option_id;
    v_url: = fnd_webfile.get_url (file_type-online fnd_webfile.request_log, id-online v_request_id, gwyuid => v_gwyuid, two_task-online v_two_task, expire_time => 100);
    dbms_output.put_line (v_url);
    end;
    /

    http://appstierservername.yourcompany.com:8000/OA_CGI/FNDWRR.exe?temp_ID=12788080980 (number will appear here)

    PL/SQL procedure successfully completed.

    SQL >

    I hope this helps.

    Published by: DBA115102 on June 10, 2011 17:27

  • the output directory is not found

    I get "the output directory is not found. Please update and try again. "I want to just post my host and I get the dialog box. I recorded it in different places and I always get the dialog box. What can I do?

    It was recorded in the folder called with ' / ' has changed to '_' and now I can publish, so weird. It didn't happen with edge of adobe. Is it possible to apply acceleration and on board where we had a couple of options with the click of a button?

  • view the output of dbms_output statement in Toad

    Hi expert,

    I use dbms_output instruction in proceudre and run it into a toad, but he must run ' set serveroutput we "display output statement dbms_output.

    But how can I achieve this functionality in Toad.

    Thank you very much

    >

    Hello

    I use dbms_output instruction in proceudre and run into a frog, but it
    should run "set serveroutput on" to display the output of statement dbms_output.
    But how can I achieve this functionality in Toad.

    At the bottom of your window, there are number of tabs. One of them is
    DBMS_Output. There is a small red button on the left side. Click on this button.
    It turns green. Then, your output is visible - you can click on it and scroll
    upward through your results.

    In the future, ask questions of Toad in a forum of Toad.

    HTH,

    Paul...

  • BUG? Interactive report select other results of the tab of Page not found

    Hi all

    I have recently updated our installation of the Apex to version 4.0.1 on Oracle 11.2. There, I found the following problem, for which I don't know if it of a bug or not:
    Steps to reproduce:
    1. Select a sample application and open a page that contains a report interavtive
    2 run the page
    3. click on "Actions" and select "filter".
    4. wait for the filter to display, and then select another tab.

    The result is a page not found. The address bar displays the link: http://apex.oracle.com/pls/apex/wwv_flow.accept with no parameters.

    I tried to use a different model and finally I turned to the sample applications. It ends up that question.

    My questions:
    1. is it already known issue
    2. is there a work around? because this can be very annoying for our client.

    Thank you!

    Select this option.

    Published by: user13295208 on 25-Oct-2010 02:54

    Hi Mark,

    I was able to reproduce the problem based on your steps. Thank you! I I produced bug # 10238450 that has already been set for 4.0.2

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Multiple selection query to view the selected line

    Hi all

    I have a requirements make multiple selection of a region in the table and need to display the values of the selected line in the page.

    so I'm able to multiple selection of the table, but all when trying to print the values, it is still only printing selected values of line one not several.

    the code I use to print several rows below the selected values.

    for (int i = 0; i < fetchedRowCount; i ++) {}
    Rowi ABCEOViewRowImpl =
    (ABEOViewRowImpl) selectIter.getRowAtRangeIndex (i);

    If (rowi! = null) {}
    If (Y".equals (rowi.getReprint ())) {" "}
    for (int j = 0; j < fetchedRowCount; j ++) {}
    String srnum = rowi.getSerialNumber ();

    throw new OAException ("after Srno" +)
    srnum,
    OAException.INFORMATION);
    }
    }
    }
    }

    where fetchedrowcount - no lines in the region of the table
    Here srnum is printing only one value.

    Please guide me where to check this problem.

    Thank you
    Deb

    Hi Deb,

    Unable to get the requirement. Why the second for loop... ?

    Still, the OAException must be thrown exception during the first use that meets the condition.

    Please try to use "srnum" in tabular or use it to add all the required values in the for loop and finally throw the exception.

    Concerning
    Sanujeet

  • Select only records where the column values are not all equal to zero

    Hi everyone, it seems so easy, but it has left me speechless on the research in a way that is clean, easy to achieve. I know when someone replies, I'm going to kick me. So, let's assume this is what I have:
    with mytable as (
    select 'Type 1' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'FEB' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAR' as monthname, 5 as theval from dual union all
    select 'Type 1' as itemtype, 'APR' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'MAY' as monthname, 4 as theval from dual union all
    select 'Type 1' as itemtype, 'JUL' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'AUG' as monthname, 0 as theval from dual union all
    select 'Type 1' as itemtype, 'SEP' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'OCT' as monthname, 7 as theval from dual union all
    select 'Type 1' as itemtype, 'NOV' as monthname, 1 as theval from dual union all
    select 'Type 1' as itemtype, 'DEC' as monthname, 2 as theval from dual union all
    
    select 'Type 2' as itemtype, 'JAN' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'FEB' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'APR' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'MAY' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'OCT' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'NOV' as monthname, 0 as theval from dual union all
    select 'Type 2' as itemtype, 'DEC' as monthname, 0 as theval from dual
    )
    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    order by itemtype
    I need an external application around it or something which will select only 'Type 1'... that is, if all months are each equal to zero, do not include the record in the result set.

    In summary to get a total of zero is not an option, because I could have-15 and + 15 in different columns, in which case, the recording should be displayed.

    Something as simple as... 'not the case (oct = 0 and 0 nov and dec = 0...) at the end is all it seems to me necessary. I thought to add a case for each column clause, but that seems not very effective. Ideas?

    Thanks in advance!
    Mark

    Edit... I know not what follows will work using the MINUS operator, but my actual query is really huge, and I don't want to have to write it twice...
    {code}
    Select
    ItemType,
    sum (case monthname when "JAN" then Val else 0 end) such as JAN,.
    sum (case when monthname 'FEB', then Val 0 otherwise end) by Feb.
    sum (case when monthname 'MAR', then Val 0 otherwise end) like MARS,
    sum (case monthname when "APR" then Val else 0 end) as APR.
    sum (case when monthname 'MAY', then Val else 0 end) either.
    sum (case when monthname "JUN", then Val 0 otherwise end) as JUN.
    sum (case monthname when "JUL" then Val else 0 end) as JUL,.
    sum (case monthname when "AUG" then Val else 0 end) as AUG.
    sum (case monthname when "MS" then Val else 0 end) as MS.
    sum (case monthname when "OCTS" then Val else 0 end) OCT.
    sum (case monthname when "NOV" then Val else 0 end) as NOV.
    sum (case monthname when 'DEC' then Val else 0 end) as DEC
    FROM MyTable
    Group of itemtype

    less

    Select
    ItemType,
    Jan, Feb, mar, Apr, may, June, July, August, Sept, oct, nov, dec
    de)
    Select
    ItemType,
    sum (case monthname when "JAN" then Val else 0 end) such as JAN,.
    sum (case when monthname 'FEB', then Val 0 otherwise end) by Feb.
    sum (case when monthname 'MAR', then Val 0 otherwise end) like MARS,
    sum (case monthname when "APR" then Val else 0 end) as APR.
    sum (case when monthname 'MAY', then Val else 0 end) either.
    sum (case when monthname "JUN", then Val 0 otherwise end) as JUN.
    sum (case monthname when "JUL" then Val else 0 end) as JUL,.
    sum (case monthname when "AUG" then Val else 0 end) as AUG.
    sum (case monthname when "MS" then Val else 0 end) as MS.
    sum (case monthname when "OCTS" then Val else 0 end) OCT.
    sum (case monthname when "NOV" then Val else 0 end) as NOV.
    sum (case monthname when 'DEC' then Val else 0 end) as DEC
    FROM MyTable
    Group of itemtype
    )
    where (oct = 0 & nov = 0 and dec = 0 and jan = 0 and 0 = Feb and mar = 0
    apr = 0 and may = 0 and = 0 jun and Jul = 0 and aug = 0 and Ms = 0
    )
    order of itemtype
    {code}

    Change again... OK, I guess that I am answering my own question here, but I think that by using a WITH to write the main request once clause and then selecting * twice using the MINUS operator between where the second query is where (oct = 0, etc.) is what I need. If anyone has better suggestions, please let me know! Here's the logic of nickname for what I come up with to date...

    {code}
    WITH mainquery as (select all)
    Select * from mainquery
    less
    Select * from mainquery where (oct = 0, nov = 0, etc...)
    {code}

    Thanks again!
    Mark

    Published by: user455268 on March 1, 2012 19:13

    Published by: user455268 on March 1, 2012 19:16

    Hello

    You can do it with a HAVING clause:

    select
      itemtype,
      sum (case monthname when 'JAN' then theval else 0 end) as JAN,
      sum (case monthname when 'FEB' then theval else 0 end) as FEB,
      sum (case monthname when 'MAR' then theval else 0 end) as MAR,
      sum (case monthname when 'APR' then theval else 0 end) as APR,
      sum (case monthname when 'MAY' then theval else 0 end) as MAY,
      sum (case monthname when 'JUN' then theval else 0 end) as JUN,
      sum (case monthname when 'JUL' then theval else 0 end) as JUL,
      sum (case monthname when 'AUG' then theval else 0 end) as AUG,
      sum (case monthname when 'SEP' then theval else 0 end) as SEP,
      sum (case monthname when 'OCT' then theval else 0 end) as OCT,
      sum (case monthname when 'NOV' then theval else 0 end) as NOV,
      sum (case monthname when 'DEC' then theval else 0 end) as DEC
    from mytable
    group by itemtype
    HAVING      MIN (theval)     != 0
    OR      MAX (theval)     != 0
    order by itemtype
    ;
    

    If the values are all 0, then the MIN and MAX will be 0.
    If the MIN or MAX is not 0, the values are all 0.

    This assumes that the combination (itemtype, monthname) is unique, because it is in your sample data.
    If this is not the case, start with a subquery that GROUPs BY itemtype, monthname, so that when you get to the main request, this combination will be unique.

  • The message "this connection is untrusted" yet once after having selected, option "I understand the risks", that is not reappear as an option

    I get these messages to Hotmail.com even, as well as the mozilla Web site. In fact, I'm on Chrome now for the first time because this is a new issue and I don't know why all of a sudden what happened. Added exceptions, I always get the message. This is not the common THREAD issue because these aren't executives as described in the other responses to this problem. I have RESET FIREFOX and although it's getting a little further with HOTMAIL.COM screen now remains empty. Support MOZILLA page is caught in the trap in an older format and not in its State Advanced. I also deleted the cert8.db file that was not working. the error message on the page is the same sec.error.issuer. I am also using Avira antivirus personal free and tried to uninstall and reinstall as it seemed to have a few features missing, but to no avail. I don't know how to disable parsing of SSL with AVIRA even though I looked briefly online. Not sure where from here, but to suffer with an old install of Firefox which does not allow me to view videos from youtube etc.

    OK, unfortunately the transmitter of fiddler2.com in the certificates could be a sign of unwanted software on your pc that is to intercept the secure network traffic. go to the system control panel and uninstall programs such as BrowserSafeguard, BrowserSafe, backup or other software that seems suspicious and did not get intentionally installed by you.
    Reference: https://support.mozilla.org/en-US/questions/982532#answer-520145

    afterwards, run a full scan of your system with security tools like the free version of malwarebytes & adwcleaner.

  • I'm trying to make a selection, and then make the background transparent.  Not having not success.  Photoshop Elements 13.

    I want to make a selection to cut the bottom of the image and let transparent.  Thought I could do but I am missing a step (or steps).

    Hello

    Please see the link below.

    http://Photoshop-tutorial.org/basics/cutting-out-an-object-without-having-background/

    How to remove the background with Photoshop Elements (with photos)

    If there is a running the commands isse, please reset PES 13 preferences... See below

    Reset preferences in Photoshop and elements

    Let me know if that helps

    Thank you

    Assani

  • How can I view the history dates are not?

    History of 31.0 FF shows today, yesterday, last 7 days, June. On July 24, the day. How can I see my history for July 1 to July 17?

    There should be a folder for this month.

  • When I select a page in the address bar is not there when I press on enter. I have to run with the arrow.

    I was able to hit just enter on websites in the drop down, before, but now it does not work. I tried the upgrade to FF4 thinking that it can solve my problem but not yet, I have to use the arrow at the end of the address bar to run to the page.

    If this does not work properly in mode without failure, then disable all extensions and then try to find out who is the cause by allowing both the problem reappears.

    • Choose "Disable all add-ons" on issues to troubleshoot Firefox in Safe Mode to set window to disable all extensions.
    • Close and restart Firefox after each change through "file > exit ' (Mac: ' Firefox > leave";) Linux: "file > exit ')
  • I am running CS5.1 on my IMAC with OS 10.7.5. When I try to catch an area for the settings I get the following warning: "WARNING: no pixel is selected more than 50% the edges will be not visible.» Then, I can't continue with my edit. What it means. It's j

    The above problem when trying to catch a space for adjustment just became a problem.

    You can have the pen in the Options bar set to a value that is too high. Reduire reduce to zero, and then try again.

  • "Show running-config" to show the output as 'technical support Show.

    Hello

    I was wondering if there was a command (maybe hidden in IOS) which would allow the release of 'show running-config' to hide passwords and SNMP community strings, a bit like when you perform a command "show support"? I'm trying to limit what a customer sees (using a GANYMEDE server +) and I just want to give them another command that would accomplish this goal. Any clue?

    Thank you

    neocec

    a. Unfortunately not. You can use 'password encryption service' to encrypt your passwords. This way your passwords are not in clear text.

    b. you can then activate levels of privilege to different users and restrict access to what a user can execute commands. For example, that a user cannot perform "show tech" or "show run" at all.

    c. but in this way, you can view the output of a command completely, or restrict access to the command completely. We can not selectively display items of an output differently to different users.

    d. you can also explore using the Protocol. SNMPv3 SNMPv3 provides a security model defining new concepts to replace username - old authentication community-based and provide the privacy of communication through encryption.

    SID Chandrachud

    TAC security solutions

    Customer support engineer.

  • How to display the output of query clause?

    Hello. I use Forms Developer 10g. I have a datablock that uses a from_clause_query. In my from_clause_query, I used a WITH AS SELECT.
    I try to view the output of this query in my forms but the first column, V_CUTOFF_TO not displayed, probably because it is not a database element. It was a result of my initial query WITH AS SELECT month. How can I view this with the release of my from_clause_query. Thanks in advance for the help. Moreover, I am trying to post the contents of my from_clause_query here, but it says sorry, this content is not allowed. I don't know why?

    I was able to solve the problem by creating a stored procedure. I insert the records in a table in the procedure, and then I query the table. Thanks for your help.

  • Unable to display the output of a concurrent program

    Dear members,

    I use Oracle R12.1.3 Vision Instance.

    I ran the program create accounting. When I click on the button to display output, the browser gets displayed and gets immediately closed. I'm unable to view the output.

    Can someone help me please to solve this issue?

    Thanks in advance.

    Kind regards.

    I faced this problem once. That's the problem with the settings of Internet Explorer.
    Check in the settings of IE-> tools - > Internet Options-> Security tab-> the zone (Intranet, for the most part)-> enable downloads.

    By
    VAMSi

Maybe you are looking for