dcsimg

SQLCourse
Interactive Online SQL Training
HOME News MS SQL Oracle DB2 Access MySQL PHP SQL Etc Scripts Links Forums DBA Talk
SQL Courses
1
2
3
4
5
6
7
8
9
10
11
12
13
14
Free Newsletters:

By submitting your information, you agree that sqlcourse2.com may send you SQLCourse2 offers via email, phone and text message, as well as email offers about other products and services that SQLCourse2 believes may be of interest to you. SQLCourse2 will process your information in accordance with the Quinstreet Privacy Policy.




LIKE comparison test operator

SELECT first_column_name, second_column_name
FROM table_name
WHERE first_column_name LIKE 'Mc%';

The LIKE pattern matching operator can also be used in the conditional selection of the where clause. Like is a very powerful character string comparison operator that allows you to select only rows that are "like" what you specify. The percent sign "%" can be used as a wild card to match any possible character that might appear before or after the characters specified. For example:

select first, last, city
from empinfo
where first LIKE 'Mc%';

This SQL statement will match any first names that start with 'Mc'. Strings must be in single quotes.

Go Back to previous SELECT page


SQL Course Curriculum
<<previous 1234567891011121314 next>>
×
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.