Home >> SQL >> Like clause in SQL

Like clause in SQL

The LIKE clause is used in a WHERE clause to compare or search a value to similar values using wildcards.

There are two wildcards used in conjunction with the LIKE clause :

1)-The percent sign (%)

2)-The underscore (_)

Syntax

1)-SELECT FROM tablename WHERE column LIKE '%XXXX'

2)-SELECT FROM tablename WHERE column LIKE 'XXXX%'

3)-SELECT FROM tablename WHERE column LIKE '%XXXX%'

4)-SELECT FROM tablename WHERE column LIKE '_XXXX'

5)-SELECT FROM tablename WHERE column LIKE 'XXXX_'

6)-SELECT FROM tablename WHERE column LIKE '_XXXX_'

Post Your Comment

Next Questions
IN clause
Order By
Group By
Distinct keyword
Sorting
Between
Having
Union
Union all
Exits
Not Exits
Any
All
Max
Min
Avg
Count
Sum

Copyright ©2022 coderraj.com. All Rights Reserved.