Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • NOT operator in SQL

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 366
    Comment on it

    NOT Operator:

    The SQL NOT operator is used to reverse a condition in a SQL query. It is used with SELECT, DELETE, UPDATE, or INSERT statement. It can be used with other operators like BETWEEN, IN , EXISTS but it will reverse the condition.

    Syntax:

    SELECT *
    FROM tablename
    WHERE columnname NOT condition;
    

    Example 1:

    SELECT *
    FROM Employee
    WHERE Empname NOT IN ( 'Sam', 'John ', 'Mitchell' );
    

    The above query will find those employee records whose name are not given within IN operator.

    Example 2:

    SELECT *
    FROM Employee
    WHERE city IS NOT NULL;
    

    The above query will find those employee records whose city column are not having NULL value.

    Example 3:

    SELECT *
    FROM Employee
    WHERE Salary IS NOT BETWEEN 5000 AND 8000;
    

    The above query will find those employee records whose salaries are not between 5000 and 8000.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: