LIKE CLAUSE



MySQL - Like Clause


MySQL LIKE condition allows wildcards to be used in the WHERE clause of a SELECT, INSERT, UPDATE, or DELETE statement. This allows you to perform pattern matching.


Syntax

The syntax for the LIKE Condition in MySQL is:

expression LIKE pattern [ ESCAPE 'escape_character' ]

Parameters or Arguments :

Expression :

A character expression such as a column or field.

pattern :

A character expression that contains pattern matching. The patterns that you can choose from are:

WildcardExplanation
%Allows you to match any string of any length (including zero length)
_Allows you to match on a single character

escape_character :

Optional. It allows you to test for literal instances of a wildcard character such as % or _. If you do not provide the escape_character, MySQL assumes that "\" is the escape_character.


EXAMPLE :

SELECT * FROM studentinfo
WHERE StudentName LIKE 'S%';

StudentIDStudentNameStudentclass
5SahayanaSixth
6SweekruthaSixth

Example - Using _ wildcard (underscore wildcard) :

SELECT StudentName 
FROM studentinfo
WHERE StudentName LIKE 'Ajaa_hi';


--------RESULT---------


-------------------
| StudentName     |
-------------------
| Ajaashi         |
-------------------


MySQL TRIGGERS

MySQL - Triggers

posted on 2019-11-29 21:44:07 - mysql Tutorials


Grant_ Revoke Privilege

MySQL - Grant_ Revoke Privilege

posted on 2019-11-26 23:15:04 - mysql Tutorials


MySQL Vs SQL

MySQL Vs SQL

posted on 2019-11-25 05:02:26 - mysql Tutorials


how to use range in golang

how to use range in golang

posted on 2022-05-03 08:28:11 - Go lang Tutorials


find variable type in golang

find variable type in golang

posted on 2022-05-03 05:24:55 - Go lang Tutorials


for loops in golang

for loops in golang

posted on 2022-05-03 04:27:40 - Go lang Tutorials