EXISTS & IN operator

Can any body give the advantages of EXISTS operator over IN?

Advantages of EXISTS over IN Clause in a Query
If you wish to retrieve from the department table all the department numbers that have at least one employee assigned to them, write the query as:
select deptno, deptname
from dept
where deptno in
     ( select deptno
from emp) ;
This query will run a full table scan on both the emp and dept tables. Even if there was an index on the deptno column of emp table, the sub-query would not be using the index and, hence, performance would suffer.
We can rewrite the query as:
select deptno, deptname
from dept
where exists in
     ( select deptno
from emp
where dept.deptno = emp.deptno) ;
This query uses an existing deptno index on the emp table, making the query much faster. Thus, wherever possible use EXISTS in place of IN clause in a query.
I cannot show you the explain plan, since I don't have these table's in my development enviroment, and I don't wish to create them, since I am at client's location. But any one of you can try this and then we can debate on this further.

Similar Messages

  • Profitability segment number 02209 does not exist in operating concern ESAA

    Hello Experts,
    Please help us on one issue which  we are facing here that
    "Profitability segment number 02209 does not exist in operating concern ESAA"
    please could you please let us know why are facing this issue and where to check if this Profitability segment number.
    Thanks and Regards,
    Mangal Modi

    HI,
    This can occur if you have deleted data from table CE41001 and have
    already assigned data to profitability segments in this operating
    concern.
    Check the OSS note: 93051, hope it may help you..
    Thanks

  • No attributes exist for operating concern

    Dear Friends:
    In our configuration client, the operating concern is active and has attributes were defined and transported. But in Unit testing client, the system says
    "No attributes exist for operating concern"
    How to over the problem?Please advise?
    How should i reward the answers?
    Regards
    MSReddy

    First try regenerating the operating concern in KEA0 in the envirionment tab. Select the activate buttons. If that does not work then retransport your operating concern using tcode KE3I.
    pls assign points if helpfu;l as a way to say thanks.

  • KE24- No Attributes exist for operating concern

    Dear Gurus,
    while iam generating the ke24 report, am getting the error message as No attributes exist for operating concern.
    Please help me out in this problem.
    BR,
    Deepak.

    Hi Deepak
    You can access change logs in KEA0 by accessing Extras -> History log. I guess this would only be available in Dev client though.
    Secondly you can also try regenerating the Operating cocern by activating it under the Environment Tab in KEA0
    Alternatively, you can also try reimporting the operating concern by using KE3I
    Hope it helps
    Regards
    Mustafa

  • Add value field to existing/ productive operating concern

    Dear All,
    I need to create a new value field and add it to an existing operating concern, which is already in use (there is already transaction data in the live system).
    In my opinion I have to do the following steps:
    1. Create new value field (KEA6).
    2. Add value field to operating concern (KEA0).
    3. Activate operating concern (KEA0).
    4. Transport operating concern (KE3I).
    Is that strategy ok?
    Is it ok, to transport an operating concern, when the system is already "live" and there is transaction data in the system?
    Thanks for your answers,
    Regards,
    Michael

    Hi,
    first create new value field in KEA6. then take those new Value field in your operating concern Data Structure in t-code KEA0. Then generate the operating Concern.
    Regards,
    Sreekanth

  • Check file existance in operating system

    Dear Collegues,
    Is there any function in oracle that checks a file existance located on local disk of windows computers?
    Like i have created a file c:\test.txt and i want to check through oracle function that this file exists or not.
    Regards,
    Imran Baig

    Is there any function in oracle that checks a file
    existance located on local disk of windows
    computers?Let's see if I understand the question correctly ...
    - You have two computers.
    - One is a client, the other is a database server.
    - You want to use an Oracle function, therefore you want to issue a request to the database server, asking the server if a file exists on the client.
    Is that correct?
    If it is correct, please tell us how the server mounts, or otherwise looks at, the client's disk? Once we have that answer, we might be able to answer your question ...

  • Select query in routing(operation,sequence)

    Hello frds,
         i am into change routing BDC actually i want a select query .....for like existing of operation for a particular sequence in routing....
    if i will found operation for particular sequence i will run the bdc code lese i will exit...any one can help me...
         just provide me a query....to check existnece of operation for a particular sequence......ASAP...

    Why on earth would you want to keep the queries separate? As Tom Kyte would say, databases are born to join!
    Providing emp_id has an index on it (and it should, assuming it's the table's primary key!) your "complex" (or, what I would call simple*), it'll most likely be faster than doing it separately. You've not got the context switches for one thing.
    If you want to see what the optimizer does with your query, you should run a trace on the query. An explain plan would give you an idea of what it's going to do, too.
    In general, doing something like this procedurally is going to almost certainly be worse than doing it in SQL (and by worse, I mean slower).
    * I'd hate to see what you'd call some of the monster queries I work with, if you think that query is complex!

  • Creating an NEW version of an existing web site

    I thought i was being smart, so i selected my existing fully operational web site in iWeb and then changed the Site Name and Published it to a local folder (different to the original site).
    This is OK I can make changes to this new site, BUT how do i get back to the original operational site? which I intend to upgrade for a while before the new site is uploaded to the www
    I cannot find anyway to open an existing site.??
    Tha
    John

    Unfortunately, iWeb cannot open published sites. If you are going to be working on multiple versions of a website I would suggest splitting your domain file you can end up with something like this:
    Though, only one site can be open in iWeb at a time

  • New operation for reference operation set

    Hi,
    I want to create a new operation for an existing reference operation set. Is a function for that use available?
    It would be optimal if there is a function that copy one operation and insert it the same reference operation set as an new operation.
    Can anybody help me? That would be great.
    Thanks
    sylvie

    Hi Naik
    This is a big question.
    You need tod quite a bit of QM reading.
    Go through the Best business practices base line packages.
    http://help.sap.com/bp_bblibrary/600/BBlibrary_start.htm
    Best regards
    Ramki

  • Try the following: Where is my profine stored? It brings you to non existing buttons etc. This is so for most iof the support.

    It 's a general problem: the structure of the "help sysytem" has been changed (perhaps in part I dion't kow) so the the flow of questions ends up to non existing (no more existing..) tips, suggestions, or whole instructions of how to, no more existing or operating.
    Very frustrating.
    I've foun my profile, in Linux, on the terminal with something like "find -name *.mab " and got it in a split second. None of the suggested ways in the help suite worked!
    This is a general question for the site designers, thanks for helping [Indeed: it's the Help menu...]. Greets,
    Giancarlo.

    unhappy and frustrated wrote:
    You make it difficult to buy your products
    Errr... no, they really don't.
    You don't need a disk (which will be out of date by the time you get it anyway) - just download the current version and insert the serial number when prompted.

  • New operating concern - order settlemement - runtime error KE499

    Hello all,
    we created a new operating concern 8000 and changed to the operating concern in KEBC.
    Now when we try to do an order settlement in KO88, it is working for new orders created after the operating concern change, but for old orders, we do get a runtime error KE499:
    Profitability segment number 0000183221 does not exist in operating concern 8000!
    Appearently this is caused by the operating concern change, because the old orders are still "connected" to our old operating conern 2000.
    Now I was wondering, is there a transaction to fix this, something that would transfer the values for the order from the old operating concern to the new one?
    Thanks
    Anne

    Hi,
    I am also getting the exact same error while running CO88 for settlement of production orders, The note recommended above deals with inconsistencies in the sales data. We had changed the assignment of the operating concerna and now we are facing the error where we are not available to pass even one settlemsnt of the production order. I cannot go and individually delete the orders and have to run settlement as a mass transaction.
    Please advise innwhat to do.
    Ariel

  • Assignment between profitability segment and operating concern

    Hi,
    When i get error like, Profitability segment (with some number say 002345) does not exist in operating concern. Then what are the Tcodes i should check in controlling?
    Thanks
    Swetha

    use se16,
    enter the table name ce3****
    - Operating concern.
    In this table u can view all the profitability segments.
    assign points if it is useful.
    guru

  • Opera 9 and System 9

    Hi, does anyone know if Opera 9 is compatible with System 9?
    Only Opera 9 will do...
    thanks very much

    eww,
    Thanks very much. Yeah, it is impossible to find things like system requirements on the Opera site. But you did it!!
    Thanks very much. I couldn't find that page to save my life.
    Unfortunately for me, I am looking specifically for certain options that only exist in Opera 9. But the little iMac G3 I'm thinking of dusting off and using for Opera doesn't have the RAM for OSX.
    So, I guess no Opera 9 for me!
    thanks for your help,
    Christian

  • Measuring Network Operations Maturity.

    Hi,
    I am  hoping that members of this group will be able to participate in a quick online survey - particulary from community members that currently or have in the past been involved in managing or auditing a Network Operations division within an organisation.
    I am hoping to find common elements used to judge the maturity of such a division from the community. The aim is to ascertain whether a maturity model can be developed or exists in some form which can be provided as a practical tool for the review or audit of an existing Network Operations division. The focus is on measurement of maturity/capability rather than on current performance.
    I am however aware that there are many organisational structures and varied responsibilities among Network Teams so will expect a variety of responses.
    The survey should take less than 10 minutes to complete and I appreciate the time spent by anyone participating in the survey as well as any comments received.
    The survey contains 3 short sections:
    Qualitative, Quantitative and Industry Capture
    http://www.surveymonkey.com/s/netopsmaturity
    Kind Regards
    Miron du Plessis

    You could try [iStat Menus|http://www.macupdate.com/info.php/id/25230/istat-menus].
    I use this to monitor temps, fan speed, disk usage, read/write speed, CPU usage and of course, network throughput.
    Hope this helps...
    D.

  • Last Confirmed Operation.

    Hi,
    What table and field can I use to find the last confirmed operation for a production order?
    Requirement:
    Production order: 1001
    Operations:
    1. Commission (Status CNF)
    2. Drilling (Status CNF)
    3. Milling (Status REL PRT)
    4. Package (Status REL PRT)
    Now, I want to pull a report that shows me the order number and Drilling as the last confirmed operation. Or even better if it shows me order number and the next operation in the sequence.
    My goal is to find the last operations confirmed for a list of orders. COOIS gives me list of all operations and shows me the status, and I am not looking for this. I do not want to see all operations.
    Your help will me greatly appreciated!
    Thanks

    Dear Mr.Rao,
    Ok one more try as follows, CO03 ---Enter the production order -
    Press F5 or
    Goto ---Overview ---Operation,Select the first operation 0010 (select that row) and
    in the top goto operation -
    display confirmation.
    Suppose if activity is not yet confirmed you will get a message "No confirmation
    exists for operation 0010.
    Check with this & revert.
    Regards
    Mangal

Maybe you are looking for

  • I messed up my IP settings.

    I was messing around with my Macbook yesterday which is never a good thing with me and somehow managed to destroy my internet. In the network tab it says Airport is connect and says self assigned IP and may not be able to connect to the internet. I t

  • Track Changes in Pages when using Voiceover

    Has anyone successfully used theTrack Changes feature in Pages when using Voiceover? I can find out how many changes there are and navigate to them, but it's not good at telling me what the change is so I can decide to accept or reject. Has anyone go

  • Function help - Tournament data copying

    Hello, I am currently making some sheets for a Tournament coming up soon and was just wondering if there is a way to automatically fill out the Quarter Final brackets using the Qualifying table and functions. For example, only checked rows from a cer

  • Dvd player not working with os lion

    my dvd player has stopped working since I installed Lion

  • Unverified email address used for Apple ID

    Hi, How does one remove a Apple ID from a iPhone 5s, which is registered with an incorrect email, and the email has not been verified.