Does an inline view execute before the rest of the select?

Hi,
The O'Reilly book Mastering Oracle Sql defines an inline view simply as a
subquery in a select FROM clause. This conforms to the definitions in
the Oracle 9i and 10g docs.
But unlike the Oracle docs, the O'Reilly book says the inline view is,
like a WITH clause, executed before the rest of the query. I can't see
how this can be done unless the inline view makes no reference to
other tables joined in the FROM clause.
Is there a species of inline view in 9i/10g that IS restricted as above -
no refs to other tables in the FROM clause - and what is it called?
Thanks for any help.
Ken Quirici

As explained above, Oracle can choose to merge the query if feasible to do so. Look at the two queries and their plans below. The plan in second query changes to creating a temporary VIEW since in that case, Oracle is unable to perform the merge:
SQL> select *
  2          from scott.emp e,
  3                  (select * from scott.dept d where d.deptno = 10) dd
  4  where
  5          e.deptno = dd.deptno
  6  /
     EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
      7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
      7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
      7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
3 rows selected.
Execution Plan
Plan hash value: 3570059291
| Id  | Operation                    | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT             |                |     3 |   171 |     2   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                |                |     3 |   171 |     2   (0)| 00:00:01 |
|   2 |   TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
|*  3 |    INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
|   4 |   TABLE ACCESS BY INDEX ROWID| EMP            |     3 |   111 |     1   (0)| 00:00:01 |
|*  5 |    INDEX RANGE SCAN          | IDX_EMP_DEPTNO |     3 |       |     0   (0)| 00:00:01 |
SQL> select *
  2          from scott.emp e,
  3                  (select * from scott.dept d where d.deptno = 10 and rownum > 0) dd
  4  where
  5          e.deptno = dd.deptno
  6  /
     EMPNO ENAME      JOB              MGR HIREDATE           SAL       COMM     DEPTNO     DEPTNO DNAME          LOC
      7782 CLARK      MANAGER         7839 09-JUN-1981       2450                    10         10 ACCOUNTING     NEW YORK
      7839 KING       PRESIDENT            17-NOV-1981       5000                    10         10 ACCOUNTING     NEW YORK
      7934 MILLER     CLERK           7782 23-JAN-1982       1300                    10         10 ACCOUNTING     NEW YORK
3 rows selected.
Execution Plan
Plan hash value: 1670713873
| Id  | Operation                       | Name           | Rows  | Bytes | Cost (%CPU)| Time     |
|   0 | SELECT STATEMENT                |                |     5 |   280 |     2   (0)| 00:00:01 |
|   1 |  NESTED LOOPS                   |                |     5 |   280 |     2   (0)| 00:00:01 |
|   2 |   VIEW                          |                |     1 |    19 |     1   (0)| 00:00:01 |
|   3 |    COUNT                        |                |       |       |            |          |
|*  4 |     FILTER                      |                |       |       |            |          |
|   5 |      TABLE ACCESS BY INDEX ROWID| DEPT           |     1 |    20 |     1   (0)| 00:00:01 |
|*  6 |       INDEX UNIQUE SCAN         | PK_DEPT        |     1 |       |     0   (0)| 00:00:01 |
|   7 |   TABLE ACCESS BY INDEX ROWID   | EMP            |     5 |   185 |     1   (0)| 00:00:01 |
|*  8 |    INDEX RANGE SCAN             | IDX_EMP_DEPTNO |     5 |       |     0   (0)| 00:00:01 |
SQL> disconnect
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
can it, in it's WHERE clause, reference other tables in the FROM clause?No. it cannot. but as said above, tha may not stop Oracle from merging the queries.
SQL> select *
  2          from scott.emp e,
  3                  (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
  4  where
  5          e.deptno = dd.deptno
  6  /
                (select * from scott.dept d where d.deptno = 10 and e.sal > 1000) dd
ERROR at line 3:
ORA-00904: "E"."SAL": invalid identifier
SQL>

Similar Messages

  • Before I updated my iPod I had all of the songs to an album that I bought on iTunes. After I updated my iPod I only have 5 of those songs from the album. I would like to know how I can get the rest of the songs cause I already paid for the album and I wen

    Before I updated my iPod I had all of the songs to an album that I bought on iTunes. After I updated my iPod I only have 5 of those songs from the album. I would like to know how I can get the rest of the songs cause I already paid for the album and I went on my computer and it said that I have to pay for them even though I already paid for the whole album. So what do I do?

    Sync with the same computer iTunes that you normally sync with.

  • I am trying to copy and paste a story from a blog.  I can only view the first page on the Pages app.  How do I see the rest of the pages?

    I am trying to copy and paste a story from a blog.  I can only view the first page on the Pages app.  How do I see the rest of the pages?

    Thank you.  That helped in the first step.  I was able to copy text onto multiple pages.
    Now I can't get the pictures to copy.  How do I get my pictures to copy?
    Also once the blog page is on pages, how do i make changes to it?
    This my story and the page I am trying to copy.
    http://www.city-data.com/forum/tennessee/359683-going-off-grid-east-tennessee.ht ml
    Thanks so much
    Lisa(writing) and Mike trying to get it right.

  • I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    I purchased Adobe CS4.  I am now being asked for my serial number and when I put it in the program does not recognize it for Acrobat Pro 9 though it does for PhotoShop, Bridge and the rest of the suite.  What can I do?

    Contact support if you have serial number issues. Otherwise start by checking this stuff:
    Sign in, activation, or connection errors
    Mylenium

  • MY new Ipod Nano does not hold a charge.  I use it mostly as a watch, perhaps look at it 5 or 6 times in 8 hours, and leave it in sleep mode the rest of the time.  I drains to the red line in less than 2 days.  My husband's nano will last a week this way.

    MY new Ipod Nano does not hold a charge.  I use it mostly as a watch, perhaps look at it 5 or 6 times in 8 hours, and leave it in sleep mode the rest of the time.  I drains to the red line in less than 2 days.  My husband's nano will last a week this way.  I thought it drained because of looking at photos, so I quit looking at them and it made no difference.  Am I doing something incorrectly to cause this short battery life?

    You are still under warranty if your iPod is "new."  Take full advantage of it by either calling iPod tech support, Apple Care if you have it or take it in to an Apple store or an AASP.  Whichever is more convenient for you.

  • I was using iMovie yesterday and it was working. But today when it started it doesn't show anything in the window on the left. No events, no projects, nothing. It's blank and so is the rest of the screen. Does anyone know what my problem might be?

    I was using iMovie yesterday and it was working perfectly. But today when it started it doesn't show anything in the window on the left. No events, no projects, nothing. It's blank and so is the rest of the screen. Does anyone know what my problem might be?
    Where does the imovie.library reside? where do the events and projects reside?

    Hi winkydb,
    Thanks for visiting Apple Support Communities.
    If you do not see the events or clips you were working with previously, first see if you can switch back to the library you were using with this method:
    Show or hide the Libraries list
    You select libraries and events in the Libraries list.
    To show the Libraries list: Click the Show button on the left side of the toolbar.
    The default location for iMovie libraries is the Movies folder in your home folder.
    You can find this information here:
    iMovie (2013): Work with multiple libraries
    http://support.apple.com/kb/PH14745
    Best Regards,
    Jeremy

  • Videos loading BEFORE the rest of the page!

    I just published my site with the new iWeb 08. The pages are loading very slowly for people because it's loading my video clips FIRST, then the rest of the page. Is there anyway to have the page load first, and THEN the video clip? Is there a setting or something that I'm missing?
    Thanks for any responses!

    Here's a trick that worked with my Podcast page and entries.
    I noticed that if you create a new text box on the page it will load before the media files. So if you click on the text box that you want to load before a media file and Duplicate it (Cmd+D) it will lay right over the top of it without anybody realizing it. And it will load first. Of course, the font suffers a little, but it accomplishes the desired effect. In case the duplicated text box isn't aligned sufficiently after the page loads, give the overlaying text box a background color that is the same as the page. That way the latent text box doesn’t even need to be visible after the page fully loads.
    This takes a bit of fudging around and re-publishing, (checking it on different browsers is highly recommended), but until Apple fixes the bug it seems like the easiest way to keep people entertained with reading while they wait for the media file to load.

  • I would like to make a movie of me speaking while doing a power point presentation.  I have seen this done with the powerpoint embedded on the screen and the speaker doing the talking on the rest of the screen.  Is it possible to do this in iMovie?

    I would like to make a movie of me speaking while doing a power point presentation.  I have seen this done with the powerpoint embedded on the screen and the speaker doing the talking on the rest of the screen.  Is it possible to do this in iMovie?

    Scrof wrote:
    ....  Is it possible to do this in iMovie?
    sure.
    the ppt has to be some kind of 'video' iM supports.
    so export it from with MS Office as a Quicktime movie, preffered with 'Animation' codec, or as appleintermediatecodec .. for quality reasons.
    you need the Talking Head as a 2nd video.
    then use iM's Pic-In-Pic feature to combine both videos as wanted.
    I would suggest to do some editing (you full-screen, the ppt full-screen, perhaps 'close ups' of some charts, cut-aways to snoozing audience, etc) to 'pep' the video. for this purpose, it could be much esier to export each slide from within PPT as a jpeg and create the 'flow' in iM only... except, you need the ppt-animations ... but, who uses animations in a presentation anyhow ... ?

  • Why does my first page print great and all of the rest are the wrong orientation?

    When I am viewing my PDFs in Adobe Reader, they look great. When I print them, the first page is correct and all of the rest are the wrong orientation.
    Please help!

    Hi there ashp,
    Try downloading and running the print and scan doctor located here:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03275041&cc=us&dlc=en&lc=en
    It can fix a lot on its own and if not give a better idea of what is going on.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Can I print a 2 page spread to .PDF from a CS 3 document where the rest of the pages are NOT spreads

    Since I do not know how to really describe this, please have a look and tell me how (if it's possible) if I can print (to PDF) this catalog where the pages (4) and (5) can remain as a spread and the rest of the document would print single pages.  I can print this as a booklet, but it's sideways online.  Our goal is to have our customers able to view the PDF online and get its full impact.  We really can't do that viewing it sideways OR by having the pages 4 and 5 split up like they are.
    http://provsnusa.com/pdf/Product%20Guide_GenRec_WEB_CURRENT_VERSION.pdf
    The problem we're having is we would like to NOT break-up pages 4 and 5.  We want this to look good for the users.
    Is it possible to have 1 spread only display all the way across - in other words, is there a way to NOT split up just pages 4 and 5 in this document?  The only way I know is to print ALL the spreads. 
    I tried: Creating the PDF with all the spreads, it does not look as good, but at least the 2 page spread is not broken up (4 and 5).
    But now if I go to print the PDF with ALL spreads, then it does not print properly on letter sized paper.  Are there settings I can embed where this will print properly where the end user does not have to make adjustments - i.e. We want the end user to be able to just hit "print" and it's done.
    I tried: I also created this InDesign CS3 document as a PDF booklet.  While this is OK, it appears sideways online to the viewer which is not desirable in this case.  Is there a way where the end user can view this correctly as a booklet online without printing?
    I guess as an alternative, I can upload the booklet for printing, and another version for viewing.
    Maybe there's a special web based PDF viewer out there or something - I'm very ignorant here.
    Any suggestions would be very helpful
    Sorry for the long wind - hope I've made sense.
    Dan

    Why not reconstruct the pages in InDesign they way you want the double pages to appear. There may even be an imposition script available that will do the trick. You could then output to pdf all the pages you want the full spread on. Leave the original to create the pages you wanted left as is.
    You can ask in the ID forum about an imposition script. I know there was one with CS4, there may have been one with CS3.

  • Is it possible to edit spoken dialog without interfering with the rest of the sound?

    I'm trying to piece together video clips from various movies, and in one of these clips the character swears strongly a couple times. Normally, I don't bother with this, but my audience is that of a "clean" nature and is strongly against profanity. Is there a way to briefly mute, or change the character's voice when he cusses and not interfere with the rest of the sound? Or is this asking too much?
    Also, I looked in the "help" section and couldn't find anything to help me with this. But I have a bunch more questions. Where do I go that will explain all the features of Premiere Elements 8, without forcing me to spend hours figuring it all out and/or posting a billion discussions here in the forums and bugging all of you with my lack of knowledge?

    What you are attempting to do requires a bit of work and then some luck.
    It sounds as though you have an Audio Clip with both background noise and possibly music, plus dialog. You wish to remove just the dialog in a particular spot, or spots. Is that correct?
    If so, then in an Audio editing program, like Adobe Audition, you can possibly extract the ambient sound/music with a Karaoke Effect, or with the application of EQ. This will yield a separate file with hopefully just the background and music, and no dialog. In a Multi-Track Session, place both files on a separate Track. Find the point where you wish to remove the dialog. Here, the workflow might differ, but I'd Cut out the dialog at that point, leaving only the Karaoke Track. To clean things up, when I had done this for each offensive passage, I would go to the Karaoke Track and do just the opposite - Cut out all that was NOT underlying the offensive passages, but leave a bit of that Track before and beyond the deleted dialog. Then, I'd add a Cross-Dissolve for Constant Power to those Karaoke segments to "ramp" the Karaoke Track into the mix, as it will never be perfect, and one wants as smooth a transition, as is possible.
    Now, one can do this in other audio editing programs, that offer Multi-Track editing, and also VST plug-ins, or install with Effects like Karaoke and/or Parametric or Graphic EQ's. You could explore the great, free audio-editor, Audacity, and Google for VST's that will enhance its capabilities. Be sure to read the Help files on Audacity, as one does need to do a few things in setup to allow the addition of more VST's.
    The work will be with the Karaoke (or similar) Effect, its result and also the frequency ranges of the speaker. That is where the "luck" comes in. Much human speech can be EQ'ed out, or at least greatly attenuated. Now, if you have a crowd talking in the background, or similar, and wish to retain that, all bets are off.
    Also, if you only have ambient sounds, and no music, behind the speaker, just find segments of that ambient sound, where the speaker is not talking, and use that to "patch" where you cut out the dialog.
    Good luck,
    Hunt

  • InDesign CS3 - Created ToC, now can't edit the rest of the document

    I have a small document -- about 56 A5 pages, no graphics or placed files, just styled text with tables -- in which I created two new pages after the title page and created a Table of Contents for insertion in them.
    I applied a new Object Style to the ToC text frames to drop them to two columns -- the rest of the document is in one column.
    Now I can't access any of the document for text editing except the Table of Contents. I can select any of the text frames with the selection tools, but as soon as I go to the text tool the cursor jumps to the end of the ToC. If I try to edit it in Story Mode, only the ToC text displays.
    What am I doing wrong? How do I get at the rest of my document for editing? I haven't experienced this behaviour before at all.

    OK, I found out what was going on.
    When I inserted the ToC, it overflowed the two pages I had alloted for it before I reset its text frames to 2 columns. As a result, it created a bunch of extra text frames on top of the existing copy.
    When I reconfigured the ToC text styles to fit its two pages, those text frames were left behind, but invisible -- whenever I tried to edit text on those pages, I was actually inserting the text cursor into these invisible text frames. Once those extra frames were deleted, I could get at the underlying frames directly again.
    I worked this out when I discovered that I could get the cursor into text on later pages and then page-up into the pages that had been overlaid.
    I haven't yet found any way of seeing what objects are on a given page apart from just looking at it, so I don't really know how to avoid this issue in future.

  • Why, when I copy and paste a shape are the rest of the pages in the doc being deleted?

    I am trying to add an identical formatted shape below the first formatted shape, but when I select, copy, paste, it is deleting the following pages of the doc.  If I'm not careful, I will lose the rest of the doc.  What is going on? 
    If I select the shape I want to copy, it is outlined in blue and under Arrange the Group/Ungroup options are greyed out. 
    There is plenty of space for the new pasted image on the page and I just click below the original image being copied to paste it. 
    And sometimes there is this thick blue line at the top of the page when copy/paste -> dissapear.  What is that?
    Also, a pasted object always defaults to Inline instead of Floating, so a new image snaps to a grid.  Anyway to change that? 

    Sorry I didn't notice that you are on iOS.
    There are two kinds of Pages documents, Word Processing and Layout.
    Word Processing documents have text on every page that automatically flows on to the next page if it does not fit on the current page. A page only is shown on screen if it has text on it. Floating objects don't count.
    If you have a complicated set of objects with wrap pushing text out of the way and text being consequently pushed over to the enxt page, odd things can happen as that text, which includes invisibles like returns, spaces, tabs, page breaks etc push over to the next page or flow back to previous pages as you move objects and make room for the etxt or not.
    Layout documents, do not auto flow from page to page. Each page is an individual section and things stay where you put them.
    It sounds like you may be better off using a Layout template for your work. Choose one from the Template/Document Chooser.
    Peter

  • I receive daily emails from the NY Times, which I read from my Ipad. Some of the emails will show all of the stories available, and some will only show a few lines in the body and the rest of the email is blank. Any ideas of what I need to do to fix this?

    I receive daily emails from the NY Times, which I read from my Ipad. Some of the emails will show all of the stories available, and some will only show a few lines in the body and the rest of the email is blank. Any ideas of what I need to do to fix this?

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray before doing the reset.

  • Making a swf wait until the rest of the HTML page is ready?

    I have a site with a common SWF embedded at the top of each page, and then regurlar graphic/text HTML content below it.
    I was anticipating that the SWF might have a bit of a delay for it to load, and that the rest of the page would be appearing pretty much right away... and that DOES happen from time to time.
    However, the one thing I wasn't expecting, and don't quite understand, is that sometimes the SWF will appear first and even start playing, yet the rest of the page doesn't appear for a second or two, so I end up with this SWF movie floating in black.
    Not entirely sure what is holding the page back, since most of the graphics are shared/common on each page.  There are some embedded videos (with poster frames, so they shouldn't take too long to load) on some pages, which are probably the culprits.
    What I don't get (besides how to further optimize the pages), is why the SWF appears and plays, if it is an element within the table that contains all the content of the page.  I thought that tables only display once EVERYTHING in it is loaded... So, why would the SWF appear before the other elements are ready?  I'm assuming the other (non-common) elements are not finished downloading... although I'm starting to suspect that maybe they are, and the delay is something else... like the embedded QT's 'initializing' or something?
    Anyway, I don't imagine there is a solution here, but I'll ask....  Is there some way to have the SWF wait for the rest of the page to finish doing whatever it is that it's doing that is causing the delay?
    Weird thing is, it's kind of random...  Sometimes it loads instantly... other times, either the SWF is floating on black for a second or two... or the rest of the page shows up, and it's the SWF that's late.
    Anyone have any advice, words of wisdom, or bits of trivia that might be of use here?

    Yep, ain't that the truth....
    Along with the randomness of the HTML elements in general, the relationship between the Flash and HTML are similarly 'independent'.
    I was just wondering if there were some little tricks or methods used by web guys these days, as it seems like clever new techniques or new capabilities in CSS or Flash pop up from time to time.
    Very odd, though...  The interface graphics are very light, yet sometimes the page takes a few seconds to show, and the Flash appears right away (the opposite of what I'd normally expect, when things 'go wrong').
    I still don't get why the SWF shows up (when the rest of the table doesn't), if the rule is true that a table won't show up unless all the content is available.
    Is there some sort of weird exception if the content of a cell is Flash?

Maybe you are looking for