Question about the order of evaluation of the clause WHERE CLAUSE when the Oracle OF the syntax used to join tables

Hello

Oracle version: 11.1.0.7.0 - 64 bit

I read the documentation online at joins. The page is avialable here: joins at

My question is about the join order of evaluation of the conditions in clause and the conditions of those

are not the join conditions and are placed in the WHERE clause.

Consider the following pseudocode

SELECT

T1. Col1,

T2.Col1

Of

Table1 t1 LEFT OUTER JOIN table2 t2

WE

(condition_expression1)

WHERE

(condition_expression2)

Is it correct to say that if there is no column on the status of join (condition_expression1) in condition_expression2, then condition_expression2 is executed before condition_expression1? In other words, oracle always trying to filter based on the WHERE clause individually each table as much as possible before joining them based on the conditions on the article?

Thanks in advance,

Hello

dariyoosh wrote:

Hello

Oracle version: 11.1.0.7.0 - 64 bit

I read the documentation online at joins. The page is avialable here: joins at

My question is about the join order of evaluation of the conditions in clause and the conditions of those

are not the join conditions and are placed in the WHERE clause.

Consider the following pseudocode

SELECT

T1. Col1,

T2.Col1

Of

Table1 t1 LEFT OUTER JOIN table2 t2

WE

(condition_expression1)

WHERE

(condition_expression2)

Is it correct to say that if there is no column on the status of join (condition_expression1) in condition_expression2, then condition_expression2 is executed before condition_expression1? In other words, oracle always trying to filter based on the WHERE clause individually each table as much as possible before joining them based on the conditions on the article? ...

The reverse is actually closer to the truth, but we can't really make general statements like that.

SQL is not a language of the proceedings.  Looking at the code SQL, we could say that the code does, but we cannot say much about how that code it.  In other words, SQL is a language that describes the results you get, not the way to get them.

The optimizer will do everything what he thinks is faster if it does not change the results.  If any order in which they are applied (in outer joins or CONNECT BY queries, for example), then think of the join is done first, and the value of the WHERE clause is applied to the result of the join.

Here is a query looks very much like you posted:

SELECT d.deptno

e.ename, e.sal

OF scott.dept d

LEFT OUTER JOIN scott.emp e ON e.deptno = d.deptno

WHERE e.sal > = 3000

ORDER BY d.deptno

;

Output:

DEPTNO ENAME SAL

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

10 KING 5000

20 FORD 3000

20 3000 SCOTT

The scott.dept table contains deptnos 30 and 40; Why are they not in the result set?  The query behaves as if the outer join is made first (production 15 rows), then the WHERE clause has been applied.  All lines with deptno = 30 had sals down han 3000 and all single line with deptno = 40 was NULL in the sal column, then these lines are excluded (as well as other lines of deptnos 10 and 20), and only 3 lines above are left.

Tags: Database

Similar Questions

  • Question about the possible use of MSVC 2008 Express as an external compiler CVI 9.0

    I was looking for these messages looking for information on the use of the ICB with external compilers, especially from MSVC 2008, and I came across this ad are about 4 months:

    "CVI 9.0 and MSVC 2008 express.

    The title of this announcement means that the freely downloadable 'express' version of MSVC can be used with CVI 9.0, but the body of the message is not in the details.  But I would really like to know if this is possible, and I'm guessing there are others here who could be very interested as well.  Page 8 of the CVI 9.0 release notes does not indicate that the Express version is supported, which makes sense.  I say this because I always thought that "express" versions of the MSVC were only to create .NET applications (C + c++ / CLI) and applications not native to Windows.  Or does change with the release of MSVC 2008 Express?

    There is no hurry to answer...

    JB

    If you have a CVI 9.0 FDS(I'm not sure about the BDS)

    Select Options/Build Options

    Select the Select button to the right of 'compiler active'.

    Click 'new' to create a new configuration of external compiler

    Select MSVC 9.0 as a model.

    Choose a configuration name (what you choose to CVI) and a destination file (where the external compiler settings will be stored).

    Click OK

    After that, you can easily select the optimizing level and the level of warnings that you need through the "Edit" in the box "compile to realease configuration.

    Kind regards

    Nicolas

  • Question about the ports used by subdaemons

    We use a direct access, no client server, with TT 6.0.4. TT is installed with port 16200. We see the subdaemons using ports such as

    32814 timestensubd
    timestensubd 32818
    timestensubd 32820
    32822 timestensubd

    Is there anyway to configure which ports are in use? SE not in 6.0.4, and then in version 7.0.5 which we will use in the future?

    Thank you
    Linda

    I'm afraid that this isn't currently possible. There should be an improvement for this request.

    Chris

  • Question about the correct use of the WM_CONCAT

    Hello

    I am trying to accomplish the following:

    from this
         ENAME
         ----------
         ADAMS
         ALLEN
         BLAKE
    ...
    and ends on this
         OLD_NAME   NEW_NAME
         ---------- --------
         ADAMS      AADMS
         ALLEN      AELLN
         BLAKE      ABEKL
    ...
    Basically, alphabetically sort the characters within each name. I have an intermediate step that seems promising
    select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
      from emp e,
           (select rownum pos from emp) iter
     where iter.pos <= length(e.ename)
     order by e.ename, substr(e.ename, iter.pos, 1);
    Yields above
    OLDNAME    NEWCHARPOS
    ---------- --------------------
    ADAMS      A
    ADAMS      A
    ADAMS      D
    ADAMS      M
    ADAMS      S
    ALLEN      A
    ALLEN      E
    ALLEN      L
    ALLEN      L
    ALLEN      N
    BLAKE      A
    BLAKE      B
    BLAKE      E
    BLAKE      K
    BLAKE      L
    ...
    the characters are in the right sequence, I thought that all I had to do was to use WM_CONCAT (and replace the comma it inserts with an empty string) and I would like to make. I thought it would do: (replacement of commas left out for clarity)
    select oldname,
           wm_concat(newcharpos) newname
      from (
            select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
              from emp e,
                   (select rownum pos from emp) iter
             where iter.pos <= length(e.ename)
             order by e.ename, substr(e.ename, iter.pos, 1)
           )
      group by oldname;
    but the sequence of the newcharpos is messed up in the process and, rather than the expected result, I get this:
    OLDNAME    NEWNAME
    ---------- --------------------
    ADAMS      A,S,M,D,A
    ALLEN      A,N,L,L,E
    BLAKE      A,L,K,E,B
    ...
    My question is, how to structure the last query so that the order of character as calculated in the inner query stays?

    Thank you for your help,

    John.

    Or

    SQL> select   oldname,
           wm_concat(newcharpos) keep (dense_rank last order by null)  newname
      from (
            select e.ename oldname, substr(e.ename, iter.pos, 1) newcharpos
              from emp e,
                   (select rownum pos from emp) iter
             where iter.pos <= length(e.ename)
             order by e.ename, substr(e.ename, iter.pos, 1)
           )
      group by oldname
    /
    OLDNAME    NEWNAME
    ---------- ------------------------------
    ADAMS      A,A,D,M,S
    ALLEN      A,E,L,L,N
    BLAKE      A,B,E,K,L
    CLARK      A,C,K,L,R
    FORD       D,F,O,R
    JAMES      A,E,J,M,S
    JONES      E,J,N,O,S
    KING       G,I,K,N
    MARTIN     A,I,M,N,R,T
    MILLER     E,I,L,L,M,R
    SCOTT      C,O,S,T,T
    SMITH      H,I,M,S,T
    TURNER     E,N,R,R,T,U
    WARD       A,D,R,W                       
    
    14 rows selected.
    

    Or (11 GR 2)

    SQL> select ename oldname, column_value newname
      from emp,
           xmltable(('string-join(for $i in (' || rtrim(regexp_replace(ename, '(.)', '"\1",'),',') || ') order by $i return $i, "")'))
    /
    OLDNAME    NEWNAME
    ---------- ------------------------------
    SMITH      HIMST
    ALLEN      AELLN
    WARD       ADRW
    JONES      EJNOS
    MARTIN     AIMNRT
    BLAKE      ABEKL
    CLARK      ACKLR
    SCOTT      COSTT
    KING       GIKN
    TURNER     ENRRTU
    ADAMS      AADMS
    JAMES      AEJMS
    FORD       DFOR
    MILLER     EILLMR                        
    
    14 rows selected.
    
  • Question about the photo (using the folders and Photos app)

    Hello

    I am new on the app Photos - aperture used briefly but never really liked. I used to manage/sort all my photos with simple folders on the hard drive. Now, I would like to move the direction of the Photos app.

    A few questions:

    1.) if I add images, are they duplicated on my hard drive when I import them from Photos?

    2.) how to delete images permanently? I need to do a cleanup, which is easier in the Photos. If I delete the images here (and also delete the "recently deleted" album), why they remain in their original on my hard drive folder?

    Any help is appreciated - thanks!

    1 - Yes by default which is highly recommended, as was the case with iPhoto you then delete the photo source since it is safe in the library

    2 - pictures works just like iPhoto - nothing outside the library is not affected by what you do in the application - see 1

    LN

  • Question about the connection using the "sqlplus / as sysdba.

    Good afternoon

    The command:
    sqlplus / as sysdba
    worked very well for the Oracle server. When I go to a client, it does not work even if I specify the correct instance. On the client, I can able to connect using one of these two commands:
    sqlplus.exe sys/abc123@"orahost.john.local:1521/dbca.john.local" as sysdba
    
    or 
    
    sqlplus.exe sys/abc123@dbca as sysdba
    
    but not
    
    sqlplus / as sysdba
    
    or 
    
    sqlplus /@dbca as sysdba
    The question is: is the form "/ as sysdba" limited to used on the Oracle server and not available for customers?

    Thank you for your help,

    John.

    is the form "/ as sysdba" limited to use on the Oracle Server

    Yes

    and not available for customers?

    Yes

  • Ask about the creation and filling I$ table on different condition

    Hello
    I have a question about the creation and filling I$ table on a different condition. In which condition the I$ table creation? And these conditions are given below:

    (1) * source and transit area * are on the same server (that is to say target is located on another server)
    (2) * gathering and target area * are on the same server (IE source is on another server)
    (3) * source, transit area and target * are * different 3 * Server
    Source 4), area transit and target are on the same server
    Thank you

    I'm not quite clear to your question. Always try my best to erase it.

    In your all over requirement I$ table will be created.
    If the same staging as target (a database, a user) then all temporary tables are created in this user
    If the scaffolding is different from the target (a database, two users (A, B)), then all temporary tables will be created under that user A (lets consider) and the data will be inserted into the target table that is present to user B

    Staging is different from the target (two database, two users (A1, A2), architecture not recommended) if all temporary tables will be created under that user A1 (A1 of the databases) and the data will be inserted into the target table which is present in user A2 (A2 data base)

    If the source, staging, the target will be under a database then no. LKM is required, IKM is sufficient to load the data into the target. Especially for this, you can see an example given by Craig.
    http://S3.amazonaws.com/ora/ODI-Simple_SELECT_and_INSERT-interface.swf

    Thank you.

  • A few questions about the Satellite A100 PSAANE

    Hi friends,

    I have a Toshiba Satellite A 100 - PSAANE with Vista Home Basic preinstalled in it.
    Now, I have a few questions... I mention below: -.

    (1) if I want to format my laptop, I need a CD to install for Vista Home basic... then I don't have this Toshiba CD when I bought the laptop. So how do? question: How can I format it?

    (2) can I change my Vista Home Basic to windows XP? I think it's much faster than this one. is it advisable?

    (3) I have a GB of RAM in the laptop. Increase the RAM? I think that my laptop has become to slow down. is it advisable?

    (4) and on my screen, everytime I try to change my profile screen to windows Classic view, my screen begins to blink. and after a while, the screen turns off. So I can't change that. I put the color scheme of windows vista only. What to do about that?

    Please help me friends. Thanks in advance.

    Kind regards
    Perkins

    Hello

    Here, a few questions about the number:

    (1) usually, you should get the Vista Toshiba Recovery DVD. If you didn t receive this DVD then you can order it here https://backupmedia.toshiba.eu/landing.aspx or you could install the disc of Microsoft Vista.

    (2) of course, you can do this. I think that Win XP drivers can be downloaded from the Toshiba driver page.

    (3) Yes, you can upgrade the RAM. For more information, see your manual or search on this forum for similar topics

    (4) maybe it s associated with the graphics driver. Check if you can update. I would recommend additional check if you are using the latest version of the BIOS

    Welcome them

  • Just a quick question about the appearance of the cluster

    Hello, this is Matthew, just a quick question about the appearance of the cluster

    Is there anyway to rearrange the order of the elements? I know cutting automatic resizing, I could move the items by hand. But if I use the cluster somewhere else, I have to move the items again...

    What I want is of the order of "Mx My Mz Ax Ay Az Temp voltage CS".

    Is there a quicker way to deal with?

    THz so much!

    You can right-click the border of the cluster and choose "arrange control cluster...". "The user interface is not as intuitive as it could be, but it will allow you to reorder items. If you use the cluster in several places, you should make the cluster in a type definition and replace all current uses of the latter with the type definition, so that they all match. They will also update automatically when you make changes to the type definition. Otherwise, you could have a situation where you have multiple groups with the same data types, but with elements in a different order, and your data will be getting a new denominated, when wire you the whole clusters. The data will be in the same order, but given that the item labels are in a different order, you can't get the data you want, when ungroup you by name.

  • Question about the differences in commands

    Hey guys -.

    I just had a few questions about the differences between orders that seem to perform the same function.  Can you let me know if an order is more preferable to the other and what the difference is.  I would really appreciate it as it I currently practice some INE laboratories and I see that orders change from lab to lab.  Thanks advance!

    1. When you write a static NAT for specific host 1 - is - this important if I understand the 32 subnet?

    EX: static (inside, outside) 1.1.1.1, 2.2.2.2 VS static (inside, outside) 1.1.1.1 2.2.2.2 netmask 255.255.255.255

    2. when I'm setting up a router as a CA server and it is necessary to "export" the key, whatever my method of exporting the key?  If so, in which method call for which solution?

    EX: key export cryptographic rsa ciscox pem URL nvram: cisco VS. exporting key 3des cryptographic ciscox pem 3des rsa terminal cisco

    3. If I have to mark a packet with a DSCP of X value, matter if I use the 'set dscp' VS 'set ip dscp?  If so, what is the difference?

    FXY

    Policy-map X

    class X

    the dscp X value

    VS

    Policy-map X

    class X

    X ip dscp value

    I guess pertaining to 2, if i was speaking in terms of from a cisco router to another cisco router - would terminal be acceptable?

    Yes, the "Import cryptographic key" command can take a url and also from the terminal entrance. In this terminal case wil is much easier.

    --
    Don't stop once you have upgraded your network! Improve the world by lending money to low-income workers:
    http://www.Kiva.org/invitedBy/karsteni

  • Question about the need to connect every 30 days...

    I understand the need for CC programs to connect to license Adobe servers, every 30 days (or it's 99, since I have an annual license?) of re - check license status.  That said, I have a question about the timing of these connections the licence renewal.

    What happens if I happen to be disconnected so far here 30?

    With the help of Microsoft for example...  I need Visual Studio to reactivate my developers license every 30 days in order for me to develop applications Windows 8 'metro '.  If I happen to be disconnected so far here 30, I am unable to work on any apps 'metro' until I got online.  (And I don't see any way to tell him to reactivate at the beginning).

    What happens with Adobe CC?

    Suppose I have license, and I am online for 29 days.  Then, the 30th day, I find myself be in offline mode when I start one of the programs of CC.  Now what?  Does the 30-day clock 'reset' every now and then during this time, or is it really only try every 30 days, and I have to be online on that day?

    Hi kenbrody,

    Please see the thread: http://forums.adobe.com/thread/1190831 .

    Kind regards

    Romit Sinha

  • A few Questions about the advanced Actions window

    Hello

    I have a few questions about the progress of the Actions (using the version of track CP7)

    1. What is the function of the action to "continue?"   Out of the peak action and advance the playback cursor?

    2. What does mean this comment "Nested calls to action advanced is a nice improvement."? Is the advanced decision at the top of a page of action tabs?

    3. What is the function of the option "custom" in the IF statement - "preform action if - custom", it doesn't seem to do anything for me?

    4. where can I get information about the timeline / playhead interaction with advanced actions, i.e. where the playhead is going again at the beginning of the slide. slide custom question - display button, e.g. verification of responses, comments - when all the objects are at the beginning of the timeline. I'm looking more for the read head of infromation functionality rather than how to implement this type of question.

    Thank you

    Donal.

    Continue: If an advanced standard action is triggered by a button, this will not trigger the playback head. If you want out, you can use continues. Continue can also be a choice in a conditional action, when one orders branching has nothing to special, but in advance. Continuous is also the "dummy" statement/command (this is the official name of a line in the dialog box advanced actions) If a statement has become unusable due to some reasons, it will be replaced by continue

    There is no nested call stocks advanced possible right now, one of my many feature requests. It would be sort of a subroutine that you can use over and over again, instead of having to create each time when necessary.

    A decision is one of the conditions to be an advanced conditional action. They allow to create more complex actions, as a loop or arrays are not possible. All decisions are executed in sequence and always.

    Custom: is a combination of or but it is rather limited, because you cannot use parentheses.

    I guess you'd better visit my blog if you want to learn more about the advanced actions.

    http://blog.lilybiri.com/

    I also did several Webinars on stocks advanced, last this afternoon (on the sharing of the actions) for Adobe. They are all available on request.

    Lilybiri

  • A question about the REEL in sqlplus command

    Hi all


    I have a question about the order of the COIL and I would be grateful if you could kindly give me a helping hand. Consider the following sql script.
    SPOOL result.txt
    SELECT * FROM mytable;
    SPOOL OFF;
    It works pretty well, and all the contents of the table "MyTable" is exported to the textfile "result.txt". However, sqlplus also prints the number of lines
    Print after each query. So after you run this script, the end of the file, I always have a line like
    ...
    "20541 lines returned"
    How can I avoid this line (the number of returned rows) in my output file?


    Thanks in advance,
    Dariyoosh

    Type this command prior to winding.

    set feedback off
    

    Kind regards
    Prazy

  • Questions about the stores in iProcurement

    All,

    I have a few questions about the implementation of iProcurement stores-

    1 oracle comes seeded with 2 stores "Backend" and "Exchange.Oracle.com. We do not have the use of these stores. I don't see an option to turn them off. Is it advisable to delete them? They occupy unnecessary space and are seen first. I read this on Metalink Note ID 429470.1 - "NOTE: while the value can be changed, it is highly recommended to not under any circumstances ever remove"Main store"page stores to manage content in iProcurement catalog administrator responsibility.» Do not know why.

    2. we have a Punchout for Dell U.S. catalog store and a catalog of information for Dell International. Buyers of Dell are iProcurement to each punchout to place their orders from Dell for the USA (shopping cart returns to iProcurement) - or - just use the store Dell International to go to an external URL and place their orders here (who do not return to iProcurement). What we see is - when the user clicks on the icon Dell us, it is taken directly to the URL of the PunchOut of Dell, but when he clicks on the Dell International icon, he was first taken to the list of catalogs available to the store (only 1 available catalog) and the user must then click again on the link Dell International. Is there a way to configure the Dell International icon to behave the way behaves in the Punchout icon - i.e. directly take the user to the Dell page without a need to show the list of catalogs.

    Hey,.
    To answer your Questions
    1. you can always delete those either if you want to... The reason why the link Meta Notes say not only not to delete the main store is
    i. because main store has all of the Local content in iProcurement (i.e. If you have any installation of items in the inventory you and them Module iProcurement Enabled (IE can be purchased at iProcurement) and any other article of local catalogues/categories Loaded using the BULK LOADING in iProcurement is also removed.)
    II. you can always delete the information Exchange Oracle store if you do not use.
    I would advise so do not remove the main store. Instead, you can change the sequence of the display of the stores you iProcurement Page.
    Browsing ==> Internet shopping Catalog Admin (RESP) ==> eContent crib ==> content management ==> stores ==> press the update sequence and make sure that the sequence number for main is superior to any other store so that the hand store falls last in the House of iProcurement Page

    2.i don't think that there is no option to do this. but you can always open an SR with Oracle about it and ask this question\

    hope that answers your Question.

    Thank you
    SANTU

  • A few questions about the difference between the Satellite P70, L70, S70

    Hello, I have a lot of questions about the P70, L70, S70 series that come with a 1920 x 1080 panel.

    (1) what are the differences between the L70 and S70 series? With the exception of the RAM and HARD drive capacity, books seem pretty identical.

    (2) P70, L70, S70 doesn't support a 2nd HARD drive or it's just the P70 series that support?

    (3) all the three (P70, L70, S70 series) come with the same TFT panels?

    (4) of the above series, which supports mSata?

    (5) all the model of each series are delivered with support from mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?

    (6) all the foregoing, are delivered with a S - ATA II or III S - ATA interface?

    (7) who is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.

    Thank you in advance.

    > (1) what are the differences between the series L70 and S70? With the exception of the RAM and HARD drive capacity, books seem pretty identical.

    What models Sat L70 and S70 do you mean exactly? There are different L70-xxx-xxx and S70 models on the market that supports different hardware specifications.

    (> S70 2) P70, L70, support a 2nd drive HARD or is - it just the series P70 that support?
    As you can see in this [Sam P70 HDD replacement document, | http://aps2.toshiba-tro.de/kb0/CRU3903II0000R01.htm] the P70 series supports the 2nd drive Bay HARD, BUT even if there is a 2nd HARD drive Bay, this does not mean that you can use the 2nd HARD drive. In the case where the 2nd HARD drive Bay are equipped with HARD drive connector, you can use the 2nd HARD drive

    I also found the [Sam L70/S70 HDD replacement | http://aps2.toshiba-tro.de/kb0/CRU3703HG0000R01.htm] the document on the Toshiba page and there I see this 2nd HARD drive Bay is not available

    (> 3) all three (P70, L70, S70 series) come with the same TFT panels?
    See point 1). Different P70, L70, S70 models were equipped with different material parts.

    (> 4) of the series above, which takes in charge mSata?
    As far as I know that some P70 models are equipped with an mSATA SSD of 256 GB.

    (> 5) do all the model of each series are delivered with support mSata? For example, it could be that L70 - a - 13 m supports mSata is not the case of the L70-a-146?
    See point 4) not all models supports the same hardware specifications

    (> 6) all of the above, come with a S - ATA II or III S - ATA interface?
    I don t think that SATA III is supported. I guess it would be SATA II

    (> 7) which is the best of these series listed? I'm trying to understand what makes the big difference of S70 to P70 except for the envelope for example.
    Not easy to answer because there are too many models released in Europea.
    And not all models are available in each country. So I guess you will have to look for the models that have been released in your country.

Maybe you are looking for

  • MacBook Pro hangs after upgrade to Sierra

    Hello I got no internet related topic by Googling on the subject. Basically, my mac has worked fine before updating the operating system most recent. Now when I use my Safari to surf on Internet, 9 of 10 times the laptop breaks down. Can anyone sugge

  • Photosmart HP 7510: Eprint compatible?

    My HP Photosmart 7510 eprint is compatible?

  • How to remove data from sleep on Apple Watch

    I have a Apple Watch with the app "sleep ++ ', I used the app for the past 2 weeks. Its linked with health Kit that works well. It appears on the dashboard. I can delete everyday I want from the phone, but they always appear on the lookout.  So now I

  • error 1639

    When I try to install the game nba 2 k 14 windows tell me error 1639 how I fix?

  • 1210 series expand type in copies

    is it possible to enlarge the type when you copy a document ono 1210 all in one? Thank you