Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Pattern Matching Using Like Operator

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 640
    Comment on it

    LIKE Operator:

    It is used to search for pattern in a table or a database . It is used with where condition. It is similar to REGEXP of MySQL.

    Syntax:

    SELECT columnname(s) FROM tablename WHERE columnname LIKE pattern-condition;
    

    Example1:

    SELECT Name FROM Employee WHERE Address LIKE 'r%'; 
    

    The above query will select those Employee names whose address start with letter "r" like rishikesh etc.

    Example2:

    SELECT Name FROM Employee WHERE Address LIKE '%a'; 
    

    The above query will select those Employee names whose address ends with letter "a" like noida,america etc.

    Example3:

    SELECT Name FROM  Employee WHERE Address LIKE '%arid%';
    

    The above query will select those Employee names whose address contains substring "arid" like haridwar etc.

 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: