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
    • 765
    Comment on it

    BETWEEN Operator:

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

    Syntax:

    1. SELECT columnname(s)
    2. FROM tablename
    3. WHERE columnname BETWEEN value1 AND value2;

    Example:

    1. SELECT * FROM Employee
    2. 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:

    1. SELECT columnname(s)
    2. FROM tablename
    3. WHERE columnname NOT BETWEEN value1 AND value2;

    Example:

    1. SELECT * FROM Student
    2. 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
Reset Password
Fill out the form below and reset your password: