Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • BETWEEN and NOT BETWEEN Operator

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 705
    Comment on it

    BETWEEN Operator:

    It is used to fetch values which lies within a range given in BETWEEN operator.

    Syntax:

    SELECT columnname(s)
    FROM tablename
    WHERE columnname BETWEEN value1 AND value2;
    

    Example:

    SELECT * FROM Employee
    WHERE Salary BETWEEN 10000 AND 20000;
    

    The above query will fetch those employee details whose salary are between 10000 and 20000.

    NOT BETWEEN Operator:

    It is used to fetch values which do not lies within a range given in NOT BETWEEN operator, all other tuple which are not in the range of NOT BETWEEN operator will get fetched .

    Syntax:

        SELECT columnname(s)
        FROM tablename
        WHERE columnname NOT  BETWEEN value1 AND value2;
    

    Example:

    SELECT * FROM Student
    WHERE Grade NOT BETWEEN 'B' AND 'D';
    

    The above query will fetch those student records whose grade are not between B and D.

 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: