Issue by not using not equals operator

Oracle: 10.2 g

Data from the sample table:
-- Table psn
type_number       name        category
1                      carl           5
1                      carl           5
1                      carl           5
2                      mike         5
2                      mike         5
3                      bob          5
3                      bob          5
3                      bob          5
4                      greg         5
5                      chris         5
6                      charles      5
6                      charles      5

--Table series
type_number       year         cat_id
1                      1999        2
1                      2000        2
1                      2001        2 
2                      2001        2
2                      2002        2
4                     1995        2
5                     2008        1
6                     2007        2
6                     2008        1
Query
select s.type_number, s.name
from   inv.psn s
 (
 select distinct temp.type_number, temp.name
 from inv.series f, 
 inv.psn s,
 where s.type_id = f.type_id
 and s.category = 5
 and f.cat_id = 2
 ) temp
where s.category = 5
and temp.type_numebr != s.type_number
Desired result set
type_number       name        
3                    bob

Hello

Whenever you have any questions, please post sample data in a form that people can use (for example, CREATE TABLE and INSERT statements) and explain how you get the results desired data matching. Otherwise, you may have a solution that happens just give the right result for the wrong reasons.
For example, the following produces the output you asked for:

SELECT     3       AS type_number
,     'bob'   AS name
FROM     series
WHERE   ROWNUM  = 1
;

and indeed:

SELECT DISTINCT
        type_number
,     name
FROM     psn
WHERE     type_number NOT IN ( SELECT  type_number
                        FROM    series
                    WHERE   type_number     IS NOT NULL
                  )
;

Both are just speculation. Guessing is not very effective.

Tags: Database

Similar Questions

  • I want to use my controller xbox 360, but windows 8 is not under operating systems, what should I do?

    I want to use my controller xbox 360, but windows 8 is not under operating systems, what should I do?

    Plug it in and let the auto drivers install.  I use mine all the time.

  • How to use 'not like' operator in BI Publisher

    We build a report using BI publisher and need to put a check where you should see only the lines where the code does not start with S. We are aware of the starts - with operator in BI publisher, but when we try to use it with no, BI publisher generates an error. Can you please let us know how to use the not operator with "starts - with" or "contains" bi publisher?

    Also how to use 'not like' operator in BI Publisher?

    Any help will be really appreciated.

    Thank you

    You can use

    not(starts-with(ELEMENT_NAME, 'A')
    
  • When the 1.00 is not equal to 1.00

    OK, I tried to look around the forum for an answer, but wasn't really sure that a similar position can be attributed to the.  I have a request that I wrote which selects a purchase order based on the State of the device being sorted.  If there are several point of sale for a particular item, the tool will focus on the priority of the Po and if there are distributions % overall of this PO.  for example, PO #1 Gets 50% of the total, PO #2 gets 25%, PO #3 gets 25%.  Once one of the op is filled, then it calculates the remaining percent.  In the example, if PO #1 is filled, he recalcuates PO #2 and #3 in. (from above) to be a 50/50 split up to one or two of these POs is filled.  It worked pretty full so far evidence - unless my production control does not guarantee that all the POs entered total 100%.  But once they check the data they have entered, we have not had problems.

    This morning I got a call that some devices are not sorting to a valid location and I walked through the vi to find what may be the issue.  As I said, if the inputs do not = 1.00, the tool does not work.  But in this case, I have 4 POs with an endowment of 0.8 + 0.07 + 0.07 + 0.06 - which in fact = 1.  But the comparison to see if this amount is equal to 1.00 is coming as FAKE!  I know that sometimes when you run are there may be truncated in some data, but this is the first I've seen that and I got only % Max to the 3rd decimal place - and this is only 2.  Help, please!

    I have attached the vi and I kept the POs 4-IN. Bay.

    When the 1.00 is not equal to 1.00?

    When you use a BINARY computer to compare.    https://en.Wikipedia.org/wiki/Machine_epsilon

    It is a 'witch hunt' super commune and it applies to all computer languages.  Basically, you can never trust a test for equality on the floats using a digital computer to test if the number is in a specific range to the place.  You can even use the constant epsilon machine in the palette of digital, if you need to get into the most accurate comparison possible.

  • How to achieve is not equal with shared filters?

    I'm trying to set a filter shared in E10, containing Contacts who do not have a certain value in a certain area.  Essentially, we have a field yes / no value and we want to include the Contacts only when the field is not equal Yes (IE. That means that the Contacts that have a number or null/white value in this area would be included in the filter).

    Does anyone know how to get there?   I would use 'Does not contain' = 'Yes' or should I use something else like 'not exactly '?

    Any suggestions or advice on that would be appreciated.

    Hi Kurt,.

    In this example where the only values in the field would be 'Yes', 'No', or null - you can use 'Does not contain' or 'Not exactly' and get the desired result. Whatever it is, you'll be alone, including those whose value is 'no', or null.

    Where "Does not contain" becomes a little difficult is when you use a multiple selection field or if the data field is a mess of bad habits or bad CRM data. Of course, it may be useful for these exact reasons as well. My recommendation is if you use a filter on a single-selection list that has own data (i.e. only in white or the values in the selection list), then use 'not exactly '.

    But, anyway anyway you mention will work in this case!

    Hope that helps.

    Kim

  • METI los datos mi tarjeta, compre ilustrator CC pero no puedo instalar no as soon as not compatible operating system, the hago como para instalar

    METI los datos mi tarjeta, compre ilustrator CC pero no puedo instalar no as soon as not compatible operating system, the hago como para instalar

    Please refer to the system requirements | Illustrator for operating system support.

    You can install CC 2014.

    Please use the following steps.

    1. Download creative Cloud desktop application from the link Download Adobe Creative Cloud apps | CC free trial Adobe
    2. Sign in using your Adobe ID and password.
    3. Go to the applications Panel and install the CC 2014 of the required application.

    Hope this will help you.

    Kind regards

    Hervé Khare

  • Specific NULL is not equal to another NULL, then why?

    Hi all

    Specific NULL is not equal to another NULL, then why...

    When I use UNION and SEPARATE, why I make only one NULL value?

    With DISTINCT and UNION I should get 3 rows as output, then why one rank (although a specific NULL is not equal to another NULL)
    Query1: (UNION ALL)
    
    with t1 as
    (
    select null comm from dual
    union all
    select null comm from dual
    union all
    select null comm from dual
    union all
    select 0 comm from dual
    union all
    select 100 comm from dual
    union all
    select 300 comm from dual
    )
    select * from t1;
    
    Query2: (UNION)
    
    with t1 as
    (
    select null comm from dual
    union 
    select null comm from dual
    union 
    select null comm from dual
    union 
    select 0 comm from dual
    union all
    select 100 comm from dual
    union all
    select 300 comm from dual
    )
    select * from t1;
    
    Query3: (Output is 3 rows)
    
    with t1 as
    (
    select null comm from dual
    union all
    select null comm from dual
    union all
    select null comm from dual
    union all
    select 0 comm from dual
    union all
    select 100 comm from dual
    union all
    select 300 comm from dual
    )
    select * from t1 where comm is null;
    
    Query4: (Output is 1 rows,I am using distinct keyword)
    
    with t1 as
    (
    select null comm from dual
    union all
    select null comm from dual
    union all
    select null comm from dual
    union all
    select 0 comm from dual
    union all
    select 100 comm from dual
    union all
    select 300 comm from dual
    )
    select distinct comm from t1 where comm is null;
    
    Query5: (Output is 1 rows,I am using NVL keyword)
    
    with t1 as
    (
    select null comm from dual
    union all
    select null comm from dual
    union all
    select null comm from dual
    union all
    select 0 comm from dual
    union all
    select 100 comm from dual
    union all
    select 300 comm from dual
    )
    select distinct nvl(comm,0) from t1 where comm is null;
    Kind regards
    Koffi

    Check this first:

    http://docs.Oracle.com/CD/B19306_01/server.102/b14200/sql_elements005.htm

    Then after if you have any questions.

    See you soon,.
    Manik.

  • model search for not equal to.

    Hi all
    I want to replace the string except beginning with SK and following numbers, but I don't have the idea about how to shape the model of research for not equal to.
    with t as 
     ( select 'Hi i am SK123
    OK, I am SK456
    Where is your friend SK678
    And SK777 is not valid' str from dual)
    select TRIM(',' FROM REPLACE_REGEXP(REGEXP_replace(str,'SK[[:digit:]]*',','),',+')) from t ;
     required output:
     SK123,SK456,SK678,SK777
    can someone let me know model research for it.

    Thank you
    RAM

    Published by: rama ch on October 23, 2012 17:41

    ch Rama wrote:
    Amadou,
    I can't understand the meaning of "." * ? "model. Could you please explain to me.

    Which can be explained by a simple example

    SQL> with t as
      2  (
      3  select 'Test SK123 test SK456' str from dual)
      4  select str,regexp_replace (str,'.*?((SK[^ ]+)|$)','\1,') str1
      5  from t;
    
    STR                                                STR1
    -------------------------------------------------- --------------------------------------
    Test SK123 test SK456                              SK123,SK456,,
    
    .* means anything as you know.
    "?" is used for making the previous pattern(.*) non greedy.
    That means when you search for anything, dont consider the patterns which will follow "?".
    Here the following pattern is "((SK[^ ]+)|$)" - which means anything starting with SK,
    followed by non-space character or end of line
    
    So it will replace anything, which will not match to "((SK[^ ]+)|$)" .
    
  • After buying the renewable subscription automatically, the latest issue did not become available

    Hi, I have a problem with my app: after buying the renewable subscription automatically, the latest issue did not become available for download/playback.

    Here are the steps I did:

    1. I chose one of the options to subscribe

    2. crossed in App purchase

    3. After crossing the In App Purchase, app updates the library

    4 after the library, the last number is not available for download. He still has the buy"" button.

    Certificates of ios seems ok (repeated several times), same steps of 3 other apps I already have.

    Buying In - app product ID are the same in the iTunes Connect and in the application through Viewer (latest version with tools v19) Builder

    In the dashboard Adobe the shared secret are set correctly, disabled paywall

    Someone had the same problem and can help me? I don't really know what I can do

    Thanks in advance

    Yes, I also confirm problems with v19. I upgraded to v20, because only in this document http://helpx.adobe.com/digital-publishing-suite/kb/subscription-purchase-doesn ' t-change-crazy io.html

    Adobe writing the solution should use the v20 and now say you otherwise?

    I opened this band of rolling over 2 weeks ago and I'm still waiting for a fix, which pay us more than two weeks of lost time? This problem is to have a very detrimental effect on my work.

  • config.msi is important issue or not because size 2.54 GB I can remove?

    config.msi is important issue or not because size 2.54 GB I can remove?

    Hello

    See if this helps you:

    http://www.pchell.com/support/configmsifolder.shtml

    http://pctechnotes.com/what-is-configmsi-is-it-safe-to-remove-configmsi-folder/

    See you soon.

  • code not equal to 0 or 1077 Mcx2Svc service name, how do I restart the service windows media extender

    Original title: code not equal to 0 or 1077 service_name Mcx2Svc how to fix and or turn it on?

    One or more services failed. The service does not stop with elegance. Display name: windows media extender service. Restart the service - HOW?

    Hello


    1. What is the exact error that you have found?
    2. what exactly is the problem you face?
    3. have you made changes on the computer before this problem?
    Method 1:
    You can follow the steps and check.
    (a) click Start reducing this includes this image, type regedit in the search box, and then click regedit.exe in the list programs.
    If you are prompted for an administrator password or a confirmation, type your password, or click on continue.
    (b) locate the following registry subkey and click on it:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Mcx2Svc
    (c) in the details pane, right-click ImagePath, and then click on edit.
    (d) in the value data box, type the following registry value, and then click OK:
    %SystemRoot%\system32\svchost.exe k fontcache
    (e) also make sure that the ServiceSidType is set to 1.
    (f) exit the registry editor and then restart the computer.
    The REGISTRY CHANGE WARNING:
    Note: this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base. How to back up and restore the registry in Windows:
    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Method 2:
    You can follow the steps and check.
    (a) open administrative tools by clicking the Start button, then Control Panel. In the search box, type administrative tools, and then click Administrative Tools.
    (b) double click Services. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    (c) right click the Media Center Extender Service and then click Properties.
    (d) on the general tab, next to startup type, make sure that automatic is selected.
    (e) if the service is not already running, under Service status, click Start and then click OK. If you are prompted for an administrator password or a confirmation, type the password or provide confirmation.
    See also:
    Windows could not start the Windows Media Center Extender Service 1068 error
    http://social.technet.Microsoft.com/forums/en-us/itprovistaapps/thread/ccbf0746-16a8-4361-824e-b73561458ad2/
    I hope this helps.
  • I get that for Windows Server 2003 is no longer supported the KBs on these issues do not have a correction action.

    I get that for Windows Server 2003 is no longer supported the KBs on these issues do not have a correction action. My network is disconnected, so the automatic update is not an option but I always receive as a vulnerability on the scans. How can I obtain the latest CRL to mitigate these vulnerabilities.

    Hello

    Thanks for posting your query on the Microsoft Community.

    I suggest you re-post your query on The TechNet Forums because we have experts working on this type of questions and for you help the better.

    Check out the link:

    https://social.technet.Microsoft.com/forums/Windows/en-us/home?category=w7itpro

    Hope this information helps. Please let us know if you need any other help with Windows in the future. We will be happy to help you.

  • When not equal then delete target does not. Please suggest.

    When not equal then delete target does not. Please suggest.

    MERGE INTO pppp pp

    With the HELP of pppp1 p1

    WE (pp.productnr = p1.productnr)

    WHEN NOT MATCHED

    THEN

    DELETE

    Hello

    2751928 wrote:

    When not equal then delete target does not. Please suggest.

    Think about it logically, is that correct?

    You say: DELETE something that does not exist. The NOT MATCHED block will be executed only when the data being sought are not found.

    AS FAR AS I KNOW:

    For NON MATCHED block, INSERT only is allowed.

    For block MATCHED, UPDATE, and DELETE are allowed.

    Take a look at this point - ORACLE-BASE - improvements in Oracle Database 10 g MERGE statement

    Please explain, in other words English, what you are trying to reach.

  • Why isn't 'if the variable does not equal null"work?

    Pretty simple thing, I thought, but it drives me batty...

    The Captivate 8.

    I have a widget for checkbox and assigned variables to all 6 boxes (framework1, evaluation2... assessment6). I also have a variable called 'null' (thanks to lilybiri). The variable has no value for her.


    So, I in my Advanced actions:


    If assessment1 is not equal to v_null or

    If evaluation2 does not equal v_null or

    If assessmen3 is not equal to v_null

    Le n

    See submit it (button)


    That means that if no the framework1, 2 or 3 etc... are verified, the assessment variables will be 'something' and not 'null' and should trigger showing button, but it does not work...


    Any ideas?


    Thank you!


    Sorry, I give up. You seem not to understand that you need another approach. Especially your answer 1 is not correct, why has the right of v_none, you are not in the mind of the person who checked it? 2 you give the opposite, what happens if the user has archived v_none really because he won't? Anywat that it is not possible to verify this with a single action advanced conditional with two decisions, because the sequence needs to be reversed for the second situation compared with the first situation. Everything should be in a single decision, with THEN/ELSE, but I do not understand the logic, so you can not help.

  • As part of the certification NAS RHEL 6 guest operating system is recommended. We see that the STAF Installation fails on RHEL 6. Because of this issue, can we use RHEL 5.7 as guest operating system?

    As part of the certification NAS RHEL 6 guest operating system is recommended. We see that the STAF Installation fails on RHEL 6. There is no rejection of STAF for RHEL 6.

    Because of this issue, can we use RHEL 5.7 as guest operating system? If so, it will lead to problems when VMware Certification?

    Seems to have been solved in WB 3.0.1

Maybe you are looking for