Mysql LIKE clause,Sql LIKE clause

Mysql,Mysql like ClauseSELECT command along with LIKE clause to fetch data from SQL table.
Using the LIKE operator in the right way is essential to increase the query performance.

syntex :
SELECT field1, field2,...fieldN table_name2...
WHERE field1 LIKE condition1 

♦ When LIKE is used along with % sign then it will work like a meta character search.

♦ You can specify more than one conditions using AND or OR operators.

Examles :

SELECT * FROM CityMas
WHERE CityName LIKE 'Coimb%';

Examples 2:

SELECT * FROM CityMas
WHERE CityName LIKE '%Coimb%';

Examples 3:

SELECT * FROM CityMas
WHERE CityName NOT LIKE '%Coimb%';

MySQL,SQL LIKE with underscore( _ ) wildcard

Examples: 

SELECT * FROM CityMas
WHERE CityName LIKE 'Coim_atore';

Post a Comment

0 Comments