Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL Tutorial -> Sql IN Operator

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 95
    Comment on it

    <-- Chapter 5: SQL Where

    Chapter 6

    SQL IN Operator


    Lets see an example from the below table "employees" :-


    employee_id name code designation salary
    101 ABC E-101 Engineer 12000
    102 DEF E-102 Doctor 8000
    103 GHI E-103 Software Developer 8000
    104 JKL E-104 CEO 12000
    105 MNO E-105 Software Developer 100000

    IN Operator Example :-


    SELECT *
    FROM `employees`
    WHERE `salary` IN (12000,100000)
    

    Now Run this Query, we will see the output below :-


    employee_id name code designation salary
    101 ABC E-101 Engineer 12000
    104 JKL E-104 CEO 12000
    105 MNO E-105 Software Developer 100000

    We can see here, only those records are displayed in which salary column value matches 12000 and 100000.


    Chapter 7: SQL NOT IN Operator -->

 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: