Difference between the operator NOT EXISTS and NOT IN

Hi experts,

I understand that this question has been asked several times, but I would like to have a clear understanding of the following:

SELECT MEANING FROM FND_LOOKUPS WHERE LOOKUP_TYPE='WIS_WORK_DEFINITION_NAME';

The results are:

Spare

Main working definition

Rework

Test

User_Defined_WD

Check

I have run this query:

select work_definition_name from  WIS_WORK_DEFINITIONS WSD WHERE WSD.ORGANIZATION_ID=207 AND WSD.INVENTORY_ITEM_ID=2686;;

The query gives output below:

MAIN

REWORK

When I run the sub query, I expect no result because the inner query in the NOT IN operator returns a NULL value.

Query -1: the query is:

SELECT fl.meaning FROM fnd_lookups fl WHERE fl.lookup_type='WIS_WORK_DEFINITION_NAME' AND fl.lookup_code NOT in
(SELECT NULL FROM wis_work_Definitions wsd WHERE wsd.organization_id=207 AND wsd.inventory_item_id=2686
AND  fl.lookup_code=wsd.work_Definition_name);

If the inner query returns null, the query gives the result:

Spare

Test

User_Defined_WD

Check

I was under the assumption that if the inner query returns null, then the global query would return no data. Example:

Query-2:

SELECT fl.meaning fl fnd_lookups WHERE fl.lookup_type = 'WIS_WORK_DEFINITION_NAME' fl.lookup_code AND NOT IN (SELECT NULL FROM dual);

The query above pulled out no data as the inner query returned NULL. What I failed to understand was the difference between the query-1 and query-2.

While Query1 returns data, query-2 not return all the data.

There is no apparent difference between these two queries, because of the last sentence of your NOT IN query:

AND fl.lookup_code = wsd.work_Definition_name

Consider the row where lookup_code = HAND. The NOT IN query is a single line in wis_work_definitions where wsd.organization_id = 207 AND wsd.inventory_item_id = 2686 AND 'MAIN' = wsd.work_Definition_name. If your queries are actually like that for this line:

SELECT fl.meaning fl fnd_lookups WHERE fl.lookup_type = 'WIS_WORK_DEFINITION_NAME' AND fl.lookup_code = 'MAIN' fl.lookup_code AND NOT in ('HAND')

SELECT fl.meaning fl fnd_lookups WHERE fl.lookup_type = 'WIS_WORK_DEFINITION_NAME' AND fl.lookup_code = 'MAIN' fl.lookup_code AND NOT in (NULL)

No one who will return a line, for reasons that are obvious, hopefully.

Now consider the row where lookup_code = TEST. The NOT IN query finds a no line in wis_work_definitions where wsd.organization_id = 207 AND wsd.inventory_item_id = 2686 AND 'TEST' = wsd.work_Definition_name. A list NOT IN containing no words can be ignored, so the two queries become like this:

SELECT fl.meaning fl fnd_lookups WHERE fl.lookup_type = 'WIS_WORK_DEFINITION_NAME' AND fl.lookup_code = 'TEST'

Which returns a line.

So the effect of these two queries is to return all values except those that appear in that particular (set of) definition (s) of work.

Tags: Database

Similar Questions

  • difference between the operational status of APs to the TOP and REG (registered)

    Hello guys,.

    I want to know what is the difference between the operational status of APs to the TOP and REG?

    Thanks in advance

    A radio operating state is up/down.  REG AP means that the PA has joined with success the controller.  The AP must be in the State REG (registry) radios appear.

    -Scott

    Please evaluate the useful messages *.

  • Pavilion 10-n102ne: difference between the Pavilion 10-n102ne and 10-n102na

    I want to order a cover for my device (Pavilion 10-n102ne), but did not, on the contrary, I think I found a similar device (10-n102na), so I was wondering what is the difference between these 2 models, not vs na, what it means. The recovery kit works on my device.

    What is the differnce between Recovery Kit or by creating a windows recovery disk, and which should I choose if I want to completely format the system and install another OS?

    Another question is that how do I backup my Windows 10 activation, or is it when I install freshly a Windows 10 the appliance will automatically activate windows? is the serial imprented into bios?

    Awaiting your response

    @ChristopherED
    Welcome to the Forums of HP,
    I hope you're well

    If I understand correctly you want to know about the difference between the Pavilion 10-n102ne and 10-n102na.

    Here is the link with the characteristics of the two products (spot the difference):

    HP Pavilion x 2-10-n102na
    HP Pavilion x 2-10-n102ne

    It is not very different between the recovery kit or one created by your computer apart from the type of creation, if the media created on your computer do not work you can always get one from HP, but you cannot create a new computer because it allows only a creation of media recovery on your computer.

    And the answer to your question about activation, you are right, that the activation code is printed/saved to BIOS if you do not have an option to save as.

    If I helped you to solve the problem, feel free to give me a virtual h.o.t. by clicking on the 'Thumbs Up' icon below.
    Thanks for posting in the Forum from HP Support.  Have a great day!
    Kind regards

  • What is the difference between the NI USB-4431 and NI USB-4432?

    What is the difference between the NI USB-4431 and NI USB-4432?

    I know NI USB-4432, but I do not know NI USB-4431.

    Hello

    Sorry for my previous post don't bother her.

    The usb-4431:

    • 4 analog inputs
    • analog output of 24-bit DAC

    Kind regards

  • What is the difference between the external SCSI cables and cables data acquisition

    Hi all, I would like to make a simple extension using an external SCSI cable and a NOR 184749/SH 6868. In other words, it would be: female HD68 bolt of the cable ends OR coupled to an external SCSI HD 68 male with a VHDCI 68 male cable. What are the differences between the external SCSI cables and cables as the (M) 6868EP of the CHS data acquisition. Other than the sex of the end of HD68 is usually on one. How is the posting hit buy using an external SCSI cable for an extension to tell a BNC-2090?

    Yes, I realize that NEITHER wants us to buy their cable, but in these economic times difficult, to do use all available resources, so I have to try,.

    Thank you

    joelowwatt

    Hello

    As long as you have compatible connectors, SCSI cables will work DAQ of basic functions.  They have the advantage of NO cables is that we can meet our DAQ hardware.  So, we can create pairs twisted differential pairs to HAVE, using the ground for shielding terminals and generally specialize the cable to minimize noise and crosstalk.  Because the SCSI cables are not specialized, you are likely to see the most noise and, if you go the sampling rates more Rapids, crosstalk.  If you are in a laboratory or factory with a good amount of noise EMF that your readings are not quite as clean, or if you have fluorescent lights you might see 60 Hz noise you might not see otherwise.

    If you want more details on the specifications of the SH68-68-EPM cable, I recommend these two articles.  The first example of the twisted pair and the principles of the SH cable shielding and the second gives the most precise specifications that you can compare with when looking for a SCSI cable.

    3GRD4C33 Knowledge Base: mapping list of the sons of SHC68-68-EPM & SH68-68-EPM cable

    1TGEHPDM knowledge base: detailed specifications for the SH68-68-EP cable

    Kind regards

  • Is there a difference between the HP Envy 4502 and 4507

    Is there a difference between the printers HPEnvy 4502 and HP 4507

    Hello

    They use the same drivers, the same software, same manuals... but one thing may not be the same: ink cartridges.

    Kind regards.

  • What is the difference between the 2000AES of Microsoft, and most expensive, 2000 Microsoft Wireless Desktop keyboard and mouse?

    What is the difference between the 2000AES of Microsoft, and most expensive, 2000 Microsoft Wireless Desktop keyboard and mouse?

    Made me. Comparing the two references, it seems that they are both the same, except that one is titled 'for business' and the other is not. The cheapest is "for companies' then perhaps originally they were to be sold in lots of dealers XX amount. If you plan to do one, get the cheaper. like you, I see no difference:

    http://www.Microsoft.com/hardware/en-GB/b/Wireless-Desktop-2000-for-business/P7K-00006#overview>

    http://www.Microsoft.com/hardware/en-GB/p/Wireless-Desktop-2000/M7J-00020#overview>

    SC Tom

  • Hi I am new to Oracle forms and reports I want to know the differences between the Enter query mode and Normal mode?

    Hi I am new to Oracle forms and reports I want to know the differences between the Enter query mode and Normal mode?

    Welcome to Oracle Forms!  Out of curiosity, what do you mean by 'new '?  You are a student or new to an organization that uses Oracle Forms?  Or just play with Oracle Forms to learn something new?

    Let me start by saying that many of your questions designtime can answer by searching in the help of the constructor of the form library.  It's accessible, like most of the other products in the Builder menu > help.

    Regarding your question, ENTER QUERY mode, as the term implies, is when it is in a State where it is accept input for the execution of a query.  When in this mode, there are various restrictions.  Yet once, it will find more details in the Builder Help.  In this case, search help for these two subjects, "SYSTEM." MODE'and "built-ins comments that are not allowed in the input query Mode".  There are many other pages that contain information about the ENTER_QUERY method, but these two should help you get started.

    Normal mode, as its name implies, is when it is in a State of 'normal '.  Basically to do nothing in particular, but also not in ENTER QUERY mode.  In this State, you can move the shape, INSERT, UPDATE, DELETE, documents, etc..

    You will find additional information, as well as a lot of documentation on the product page of forms of OTN:

    http://www.Oracle.com/technetwork/developer-tools/forms

  • What is the difference between the role of support and the user role in the business group?

    I know there are a few differences between the role of support and the user role in the business as business group elements and Management group

    editable settings . But I can't find any document that introduces more precisely what they can do, what they can't.

    Are there any articles or documents or other means that can tell the specific differences between the Director, support and user group?

    If you have not taken a glance at this map permissions by GrantOrchard you should. It is very useful to know what permissions each user role. The big difference between the role of support and the user is that the user can only do things for themselves and user support can do things on behalf of other users. There is nothing quite as granular as you specified.

  • Differences between the HP Deskjet 3522 and HP Deskjet 3520?

    Hello

    Is could someone please tell me what is the difference between the HP Deskjet 3522 and HP Deskjet 3520?

    I've seen both for sale online and can see no difference between them... so don't know why different model numbers

    Thank you!

    The difference in the number of products, is because it coordinates with the serial number.

    So when you have a problem, or warranty issues, the number of the product will compete with the serial number in the system.

  • Differences between the Sony HX - 90V and HX-90V/B?

    What are the differences between the Sony HX - 90V and HX-90V/B?

    Thank you!  I am a beginner photographer.

    The B means that it is black.

  • What is the main difference between the models eprint 3070 and 5510?

    What is the main difference between the models eprint 3070 and 5510?

    Hi Potter1234,

    I think the 5515 is for a different region outside the United States / Canada region.

  • I want to know the differences between the conditions of subscription and use of Photoshop for photographers of the usual subscription?

    Nice day! I want to know the differences between the conditions of subscription and use of Photoshop for photographers of the usual subscription? And if I can buy then and for how Adobe Illustrator? What will be the beta of the Adobe XD for Windows? Thank you!

    If you ask what is the difference between photographic subscription and the subscription of stand-alone application, then the answer is both are essentially the same except for two ways. The photographic edition comes with Adobe Lightroom and 2 GB of cloud storage. The stand-alone Photoshop version comes on its own, but with 20 GB of cloud storage and is two times more expensive. If the 18 GB of cloud storage is an additional value, I would say probably no - put the money that you save on an external hard drive in place. The photographic edition was initially a temporary special offer caused a suggestion from one of the co-creators of Photoshop, but turned out to be very popular with fans, private and business and so we have a permanent plan to subscribe to Photoshop. There is no plan equivalent to Illustrator and who is available at a single price. With the subscription model, you can cancel at any time, but the contract is 1 year, if you cancel at the beginning there is a penalty clause which will ask you to pay extra this tax applies only if you pay your monthly subscription every year.

    You don't say where in the world you are, but the link below shows the available plans. There is a drop down box that allows the conversion in different currencies.

    Pricing plans and creative Cloud membership | Adobe Creative Cloud

    Hope that helps.

    Terri

  • What is the difference between the type of table and view?

    Hello world.

    What is the difference between the type of view and table that we can set using SQL statement such as: "tab type is table of...» » ?

    A view is a stored query.

    An array type is a construction of PL/SQL.

    Both are documented:

    http://docs.Oracle.com/CD/E11882_01/server.112/e10897/schema.htm#ADMQS0841

    Management of schema objects

  • What is the difference between the mixture of photoshop and photoshop fix?

    Apart from the application of Mix are available on Android devices, is there a difference between the function of correction and Mix capabilities, the latter being only available only on Apple devices?

    Hi garlands!

    Yes, applications are designed for two different workflows: compositing for Mix and editing to Fix.

    Visit this link for more information!

    What is the difference between a mixture, Fix and Express?

    Let me know if that helps

    -Thanks!

    Kathleen

Maybe you are looking for

  • After the upgrade to 7.0 I can't connect

    Skype has stopped working after I updated to 7.0, it freezes when it gets and displays an error message in the morning with the old version, I used Skype, now I can't used more and I don't know why. You don't see the error message in the attachment,

  • How can I reduce the folder winsxs, on a Windows Server 2008/R2 server?

    Hello I am currently working for the NHS and we have a more complete series of 150 servers primarily boxes of Windows Server 2008 R2. We have found that we constantly get alerts for a not enough space on countless servers and found this ha winsxs it'

  • FM Radio App missing

    Hello! I can't find the FM Radio app to my Lenovo A536. I checked in the specs, but it says that it has installed in to the FM radio. I was going to use it, but then I can't find it. What could I do to fix it and have FM radio?

  • How to get outlook on my surface? can I download? Buy it in the store? It is already loaded? Thanks for the tips

    How to get outlook on my surface? can I download? Buy it in the store?  It is already loaded? Thanks for the tips. John Harney

  • Mask falls its place after?

    Hi, I worked on a mask of movement for a few hours and made sure to cover each frame. I did not fail a framework and I made sure that the FPS is the same in both composition and rendering parameters settings. The mask looks good when I saw it (by pre