LIKE operator is used for pattern matching.
e.g.
To find name and salary of employees whose first name starts with 'A':
SQL> select first_name,salary from employees where first_name like 'A%';
To find name and salary of employees whose first name starts with 'A' and followed by 3 characters:
SQL> select first_name,salary from employees where first_name like 'A___';
Have a question or comment? Post it below!
Saturday, November 13, 2010
Subscribe to:
Post Comments (Atom)

3 Comments:
Hello Sir,
I used the like operator and i have one question about it....as in example given above, if i want to find out the name and salary of employees whose first name starts with 'A' and 'D',then how to do that. I used'and' operator but its not working.....
Thanks,
Try this:
SQL> select first_name from employees where first_name like 'A%' or first_name like 'D%';
ThankYou Sir....i missed to put first_name with 'D'.
Post a Comment