where col article! = « Y »

Oracle 11g r1.

Table TEST

Column: name varchar2, varchar2 flag

Records:

FLAG OF NAME

Jon

Mike

Brian Y

Jay Y

Select * from test where flag = "Y" returned:

Brian Y

Jay Y

What is expected.  Now,.

Select * from test where flag! = « Y »

RESULTS: no rows selected

I was expecting retune of

Jon

Mike

What's wrong?

Nothing wrong with the exception of your understanding of the works of NULL.

NULL is not equal to "Y".

NULL is also not not equal to "Y".

Select * from test where flag! = 'Y' or flag is null

is what you probably wanted.

Tags: Database

Similar Questions

  • Update query works well when a subquery in where the article is wrong.

    Hello

    I executes a statement-update

    Update table set Column1 = 2000
    where a.column2 in (select column 3 of table b where b.col4 = 111)

    Now when I run the subquery: select column 3 of table b where b.col4 = 111-> it gives me the error ' identifier not valid col 3.

    But when I run the full query, then it updates the 700 lines.

    Can someone there explain please?
    My subquery throw error but when I use it in another application it works well.

    Col_3 must be in your external table (table_a, I guess).

    If you always the prefix names of columns with a table alias, you know in an instant.

  • ESXi free 6. Might be a stupid question, but how/where to get the license for?

    Hi all

    Every time I try to download and then navigate to the license key for ESXI hypervisor 6.0 free I get redirected to "My wmware" page where I can download / select 'vSphere and vSphere with operations management', but which does not provide me with a license key as just run in a 60 day trial.

    Even if I try a direct link, such as: https://my.vmware.com/en/group/vmware/evalcenter?p=free-esxi6 it would fail, is to pursue this matter I might be told "You are not enrolled in this product." and if I hit the [register] button it would to the page "My VMware" and loops...

    Is the past when downloading the 5.0, 5.5 and those where an article to the called component download page where him compares keys such a list, I don't see the part.

    So what I'm missing here?

    Concerning

    Otto

    Please try https://my.vmware.com/en/web/vmware/evalcenter?p=free-esxi6

    André

  • using where clause with value to hardcode in run immediately

    Dear Experts, I use below in the stored procedure make exception.

    RUN IMMEDIATELY "REMOVE CC. TB WHERE COL ='HG ";

    When the collar is varchar2 (30) DC. TB

    Please guide how to use above the statement in the stored procedure


    Thank you

    DBA wrote:
    Dear Experts, I use below in the stored procedure make exception.

    RUN IMMEDIATELY "REMOVE CC. TB WHERE COL ='HG ";

    When the collar is varchar2 (30) DC. TB

    Please guide how to use above the statement in the stored procedure

    Thank you

    Why you use dynamic SQL? DELETE statement is a DML statement and its valid inside a PL/SQL block.

    So, you can remove the immediate execution and write your DELETE statement directly.

    begin
      delete from cc.tb where col = 'HG';
    end;
    
  • "Invalid column" on the place where several clauses with subqueries and cfqueryparam

    I see a behavior in the cfquery coldfusion I would like to find an exmplanation for.  I have a query that performs a subquery in the select part and if I have several where lines, I get a message 'invalid column name' to find out where my second article, but only when I'm with cfqueryparam

    For example, on what follows, I get "invalid column name «position_id»»

    SELECT department_staff_tbl.*,
    (SELECT max (bookmark_id)
    OF bookmarked_items_tbl
    WHERE item_id = department_staff_tbl.staff_id

    ) AS bookmark_id
    OF department_staff_tbl
    WHERE department_id = < cfqueryparam value = "" #arguments.deptid # "cfsqltype ="cf_sql_integer">"
    AND position_id = < cfqueryparam value = "" #arguments.posid # "cfsqltype ="cf_sql_integer">"
    AND staff_id = < cfqueryparam value = "" #arguments.staffid # "cfsqltype ="cf_sql_integer">"

    If I change the order of my where clause staff_id is first, and then he said "department_id" is an invalid column.

    If I don't have a where clause, it works.  (i.e. WHERE position_id = < cfqueryparam value = "" #arguments.posid # "cfsqltype =" cf_sql_integer">).

    If I remove the where clause of my subquery (WHERE item_id = department_staff_tbl.staff_id) it works.

    This also works if I remove the cfqueryparam where my article so that my query looks like this:

    SELECT department_staff_tbl.*,
    (SELECT max (bookmark_id)
    OF bookmarked_items_tbl
    WHERE item_id = department_staff_tbl.staff_id

    ) AS bookmark_id
    OF department_staff_tbl
    WHERE department_id = #arguments.deptid #.
    AND position_id = #arguments.posid #.
    AND staff_id = #arguments.staffid #.

    Any thoughts?

    A more conventional way to enter your data is without the subquery.  Something like that

    Select fields, the bookmarkid max (bookmark_id)

    from bookmarked_items__tbl join department_staff_tbl on staff_id = bookmark_id

    When etc.

    Some field group

  • REGEXP_SUBSTR in where clause

    select * from abc;
    
    COL
    ----------------
    -xxx 999 yyyy123
    03112X
    123:1
    34455
    3456xyc
    xxx234
    xxxxxx
    
    7 rows selected.
    
    
    select 
    REGEXP_SUBSTR ( col
               , '[0-9]+'
               )
    from abc;
     
    REGEXP_SUBSTR(CO
    ----------------
    999
    03112
    123
    34455
    3456
    234
    
     select * from abc where col =
    REGEXP_SUBSTR ( col
               , '[0-9]+'
               );   
    COL
    ----------------
    34455
    Why the two above sql output is not similar?

    How does it work?

    Thanks in advance.

    Hello

    The first query you change the output of all the selected columns, the second you are filtering. See [REGEXP_SUBSTR | http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/functions138.htm#i1239858] for more information.

    Kind regards

  • Recently purchased - missing

    Hello

    I tried to find a shopping list recently updated on my Apple TV in 2015 without success.  Many sites refer to the display of the section "purchased" from the App Store TVos where an article appears on the left indicating the categories and recently updated apps.

    What's the one feature Store US because here in the United Kingdom, I see only the icons of the screen to fill?

    If I am missing a setting, can someone show me what?

    Please see below for what I'm trying to achieve - I have never been able to get this list on the left!

    Thanks in advance,

    I am in USA and I can confirm this is the view I have.  I do not know if it varies according to the region like so many other services...  Maybe someone in the United Kingdom can check?

  • issue of white macbook

    I have about 40 old white MacBook about 5-7 years (not sure).  During Thanksgiving weekend, 2 of them had something to do where an article has increased in size to the point where the pavement jumped out of his position.  I don't know what's under the pavement, but would like to know what could be the cause.  I plan to take off the back to watch.  They were not connected in charge, but just sitting on a table.  Risk of explosion or fire?  Someone else has similar things happen like that?

    It would be the battery swells. You should get looked at them immediately before the swelling causes irreparable physical damage.

    The defective batteries must be disposed of as soon as possible. The swelling is a very common failure mode. If the MacBook were not so old, the batteries have been replaced under an extended warranty with Apple.

  • Button-table with colors?

    Hey everybody,

    I made a matrix table buttons (please open my attached picture to understand what I wanted).

    I want to do two things:

    1 make the clickable buttons, and to make an event every time that one of them was clicked by the user.

    2. to control the color of each sepertly button in the table.

    I use CVI 2013 with academic courses.

    Who are possible? and what are the commands that I can use for these tasks?

    Best,

    Tom

    Button cells are already active as far as the table either warm or normal mode.

    If in hot mode, you receive an EVENT_COMMIT in the callback of the table: you can detect and then press the call GetTactiveTableCell key and contact information processing cell.

    Individual cells can be painted in colors as Panel, the command is enabled is not to follow the Windows theme: change the attributes of the Control Panel, select other attributes... and uncheck use Windows visualization Styles to checkbox controls.

    The only table can also be defined this way leaving the Panel and other controls to join the theme: you can get this by calling:

    SetCtrlAttribute (panelHandle, PANEL_TABLE, ATTR_DISABLE_PANEL_THEME, 1);

    In this case, the individual cells must be painted programmatically by calling:

    SetTableCellAttribute (panelHandle, PANEL_TABLE, MakePoint (col, row), ATTR_CMD_BUTTON_COLOR, VAL_CYAN);

    where col, row are 1 column and index of the row of the cell base to work on. The function will fail if the cell is not a button.

  • Sudden loss of all Microsoft and ITunes data, music, photos and custom settings files

    I had a sudden loss of almost all parameters of data and the computer.   All files of microsoft, word and Excel documents, photos, music, saved internet Favorites had suddenly disappeared.  The computer screen and settings looks like it is crowned by the factorr.  All saved internet favorite sites have been demolished.  It shows only the dell sites in the section registered site.  However, the data contained in limit customer management software hs was not made. This suddenl happened when the computer starts. I had to put my password in two or three times I thought because of spelling errors my password.  My computer is infected, hijacked or even my stolen identity?  What is gravity is this and is there a way to get my restored data, images and music files?

    I had a sudden loss of almost all parameters of data and the computer.   All files of microsoft, word and Excel documents, photos, music, saved internet Favorites had suddenly disappeared.  The computer screen and settings looks like it is crowned by the factorr.  All saved internet favorite sites have been demolished.  It shows only the dell sites in the section registered site.  However, the data contained in limit customer management software hs was not made. This suddenl happened when the computer starts. I had to put my password in two or three times I thought because of spelling errors my password.  My computer is infected, hijacked or even my stolen identity?  What is gravity is this and is there a way to get my restored data, images and music files?

    It sounds as if your user profile is damaged.

    To confirm, perform the following steps:

    1. Create a file of any type and save it in "My Documents" of the account, which seems to have lost everything.
    2. Search for the document.
    3. When it is found, right click and choose Properties.
    4. Click the general tab and view the information next to the 'location '.  It will be C:\Documents and utilisateur\Mes Documents Settings\nom
    5. Make a note of the user name
    6. Now search for a document that you know existed.  Get location and to compare the value of username to this file that you just created.

    Did you find the old file?  Was the location your former username user name and the user name for the new file a variant of that?

    Also, please answer the next 2 questions, in the event where the article below does not help:

    1. You use a profile (user name) that you created or that you use the built-in account named "Administrator"?
    2. Also, what version of Windows XP you are using, including service pack?

    There are several Microsoft KB articles that should help you.  First, see this one:
    http://support.Microsoft.com/kb/555473

  • Malware poster, printing problem

    I was helping a friend with a very aggravating issue.

    My friend is running WinXP SP3 with four profiles.  Recently, the system was hit by a malicious program that touched a single profile.  I was able to remove the malware and bring them up and running successfully.  Unfortunately, a problem of printer appeared after the fact.

    In summary, when a print command is sent from any program, the document appears in the print queue and disappears as if printed.  However, the printer prints the document.  I reinstalled the printer driver and software twice so far.  Whenever I have do the relocation, the printer works for the profile that I have installed since then but will not work for any other profile. (Yes.  In the installation, I checked that all users have access to the printer) I also re - run various antivirus scans and malware (MS Security Essentials, SuperAntiSpyware and Malwarebytes').  All scans have prepared own.

    I speculate that something can become corrupted or altered by the malware itself or cleaning.  I don't know where to go from here.  Create a new profile to see if it includes all the features?  Run a repair of the BONE?  All these sounds like stab in the dark.

    Anyway, if someone has encountered an error similar to this one, I would really appreciate the help.

    Thank you!

    To the right: this is the forum of material and Windows XP drivers

    This is important because the SFC in Windows XP does not have damaged or /offwindir as an option.
    Please read: KB310747 - Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    First of all, these options become available in Windows Vista®.

    Run SFC in Windows XP, to a Windows distribution CD and the CD for the latest service pack (if one is installed).

    From an Administrators account, type: -R, sfc/scannow

    SFC calls for, first of all, your installation media, and then later the service pack CD-ROM.  If SFC wants to replace the files, leave.  If the SFC rejects your Service Pack CD-ROM, read the KB900910 Microsoft Knowledge base article.  Note that this article applies to SP2, but is also applicable to the SP3.  Just use your common sense and use SP3 where the article refers to SP2.

    If you don't have a CD-ROM Service Pack 3, or order it (U.S. / Canada , Europe, Africa , Asia or South America ) from Microsoft or download the ISO (here ) and burn it.  Be sure to Select the appropriate language if you download ISO.  Note, I recommend that you install Service Pack 3 on a CD-ROM, rather than through Windows Update so that you pouvez use SFC with success!

  • Cannot find \Windows\System32\hal.dll__

    Cannot find \Windows\System32\hal.dll

    XP pro upgrade, not product complete

    It comes to the hardware layer for Extraction (HAL) DLL.  Look for a copy in % systemroot%\ServicePackFiles.  If it is not in this directory, you probably have not installed the latest Service Pack.  If this isn't the case for updating hal.dll, install Service Pack 3 now the CD-ROM (see below), not Windows Update in order to run the (SFC) System File Checker utility in the future.  If she is in... \ServicePackFiles, recopy the % systemroot%\system32.  You need to be in safe mode to copy this file.  Do not copy from %systemroot%\$NTServicePackUninstall$ if it is there.

    If you have already installed Service Pack 3, since an administrator account, try the following in a "cmd" window ( -R,cmd):

    Letter
    %Systemroot%\ServicePackFiles CD
    Expand sp3.cab - %systemroot%\system32\: Fhal.dll

    If all else fails, you can run the utility auditor of file system (CFS) to try to restore the missing files.  From an administrator account, type:

    -R, sfc/scannow

    SFC calls for, first of all, your installation media, and then later the service pack CD-ROM.  If SFC wants to replace the files, leave.  If the SFC rejects your Service Pack CD-ROM, read the KB900910 Microsoft Knowledge base article.  Note that this article applies to SP2, but is also applicable to the SP3.  Just use your common sense and use SP3 where the article refers to SP2.

    If you don't have a CD-ROM Service Pack 3, or order it (U.S. / Canada , Europe, Africa , Asia or South America ) from Microsoft or download the ISO (here ) and burn it.  Be sure to Select the appropriate language if you download ISO.  Note, I recommend that you install Service Pack 3 on a CD-ROM, rather than through Windows Update so that youpouvez use SFC with success!

    Please, vote if it is useful!  Please, click on Mark as answer if that answers your question.

  • I need a driver/files mouhid.sys, my mouse support does not work. Please thank you!

    I need a driver/files mouhid.sys, my mouse support does not work.  Please thank you!

    Hmm, a strange thing to have disappeared.  Do you have a virus or checked for malware scanner?

    The mouhid.sys file is supposed to be in % systemroot%\system32\drivers.  You pouvez find a copy of it in % systemroot%\dllcache.  If it's not in... \drivers and is in... \dllcache, recopy the... \drivers.  (You may need to do this in Mode safe.)

    Except for the above bit of luck, there are several ways to recover.

    1. use msconfig:

    Get your installation CD or locate a copy online
    Since an administrator account, run msconfig ( -R, msconfig)
    When "msconfig" opens, select the "Général" tab and click on the button "expand file...". »
    (This will open the window to "Develop a Source of Installation file")

    Enter 'mouhid.sys' in "file to restore:
    Enter the path to the DRIVER. CAB file in the \i386 on your installation media directory.
    (or browse to...)
    Enter "c:\windows\system32\drivers" in the "save in:" entry.
    Click "expand".
    'mouhid.sys' is now where never told you develop to...

    2 use the utility auditor of system files (SFC) to check the missing files and restore them if necessary.
    You will again need your installation media and, if you have installed the Service Packs, the CD-ROM for
    the latest Service Pack, you have installed.

    From an administrator account, type: -R, sfc/scannow

    SFC calls for, first of all, your installation media, and then later the service pack CD-ROM.  If SFC wants to replace the files, leave.  If the SFC rejects your Service Pack CD-ROM, read the KB900910 Microsoft Knowledge base article.  Note that this article applies to SP2, but is also applicable to the SP3.  Just use your common sense and use SP3 where the article refers to SP2.

    If you don't have a CD-ROM Service Pack 3, or order it (U.S. / Canada , Europe, Africa , Asia or South America ) from Microsoft or download the ISO (here ) and burn it.  Be sure to Select the appropriate language if you download ISO.  Note, I recommend that you install Service Pack 3 on a CD-ROM, rather than through Windows Update so that youpouvez use SFC with success!

    Please, vote if it is useful!  Please, click on Mark as answer if that answers your question.

  • Basic SQL question

    CREATE TABLE test_table_1
    AS
       (    SELECT ROWNUM col
              FROM DUAL
        CONNECT BY ROWNUM <= 10);
    

    CREATE TABLE test_table_2
    AS
       (    SELECT ROWNUM col2
              FROM DUAL
        CONNECT BY ROWNUM <= 10);
    

    DELETE FROM test_table_1
          WHERE col IN (SELECT col                      ---------------------- There is no such column called col in test_table_2
                          FROM test_table_2);
    
    10 rows deleted!
    
    COMMIT;
    

    The column inside the subquery has never existed...

    SELECT col FROM test_table_2;                                ---  ORA-00904: "COL": invalid identifier
    

    How is it possible that a non-existent column is not followed while the application is being analyzed

    Can someone explain this if you please...

    Thanks for reading!

    Oracle version: 11.2.0.3.0

    See you soon,.

    Manik.

    1. DELETE FROM test_table_1
    2. WHERE col IN (SELECT col - there is no such column called col in test_table_2
    3. OF test_table_2);

    Quite expected behavior.  Cervical in your subquery refers to the same pass in your outer query.

    If you called your columns with a table alias (or the name of the entire table if you wish) the error would have been taken:

    SQL > DELETE FROM test_table_1 T1

    2. WHERE T1.col IN (SELECT T2.col

    3 test_table_2 T2);

    WHERE T1.col IN (SELECT T2.col

    *

    ERROR on line 2:

    ORA-00904: "T2." "" COL ": invalid identifier

  • Why B * TREE index does not work when ask explicit type conversion.

    What is the job of back-end of B * column indexed with numeric type data when to perform explicit Conversion in the WHERE clause of number of Char.

    Basically my question is why index does not work when applying both sides TO_CHAR conversion in where clause?

    Let's say we have a table with 1 million rows

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

    Create Table T (collar number);

    -The unique index on the column.

    CREATE A UNIQUE IDX_T ON T (CSA COL) INDEX.

    -Insert the statement on the table with million lines

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

    Begin

    For I In 1.1000000 loop

    Insert Into Values T (I);

    End loop;

    COMMIT;

    End;

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

    We have different situations using

    explain plan for select col from t where col =?;

    SELECT * FROM TABLE (DBMS_XPLAN. DISPLAY);

    Case 1.  Where COL = 50555;

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    0 | SELECT STATEMENT |       |     1.    13.     0 (0) | 00:00:01 |

    1.  INDEX UNIQUE SCAN | IDX_T |     1.    13.     0 (0) | 00:00:01 |

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

    Information of predicates (identified by the operation identity card):

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

    1 - access ("COL" = 50555)

    Case 2.  Where COL = '50555';

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    0 | SELECT STATEMENT |       |     1.    13.     0 (0) | 00:00:01 |

    1.  INDEX UNIQUE SCAN | IDX_T |     1.    13.     0 (0) | 00:00:01 |

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

    Information of predicates (identified by the operation identity card):

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

    1 - access ("COL" = 50555)

    Case 3.  Where TO_CHAR (COL) = 50555;

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    0 | SELECT STATEMENT |      |     1.    13.   470 (6) | 00:00:06 |

    1.  TABLE ACCESS FULL | T    |     1.    13.   470 (6) | 00:00:06 |

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

    Information of predicates (identified by the operation identity card):

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

    1 - filter (TO_NUMBER (TO_CHAR ("COL")) = 50555)

    Case 4. Where TO_CHAR (COL) = '50555';

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

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

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

    0 | SELECT STATEMENT |      |     1.    13.   463 (5) | 00:00:06 |

    1.  TABLE ACCESS FULL | T    |     1.    13.   463 (5) | 00:00:06 |

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

    Information of predicates (identified by the operation identity card):

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

    1 - filter (TO_CHAR ("COL") = '50555')

    Why the access descriptor became predicate to filter in case 3 and 4?

    Please, help me understand.

    ACCESS (Index Scan) - Oracle tries to use an index one try to access a table row that they are interested.

    FILTER (full table scan) - Oracle has no any tool to directly get to the table of ranks it is interested in, so it must pass all the lines and then filter the rows that match the main condition.

Maybe you are looking for