python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
15 Best SQL Queries for Developers [SQL Queries]

SQL WHERE LIKE Statement

The SQL “LIKE” operator is use with “WHERE clause to search a specific string in the columns and Here is “two” wildcard characters (%) percent and (_) underscore using LIKE operator.

The percent sign (%) represents zero, one or multiple characters and the underscore (_) represent a single character or number.


Syntax:- 
SELECT ColumnName, ColumnName
     FROM TableName
WHERE ColumnName LIKE value 

Examples:-
--SELECT ALL COUNTRY
SELECT * FROM Countries

Result :-
Id CountryName CountryCode
-----------------------------------
1 India        IN
2 Nepal        NP
3 USA        US
4 Rasia        RA

Query:-
--SELECT WHERE LIKE
SELECT Id, CountryName
  FROM Countries WHERE CountryName LIKE 'I%'

Result:-
Id CountryName
-------------------
1 India

Query:-
SELECT Id, CountryName
  FROM Countries WHERE CountryName LIKE '%a'

Result:-
Id CountryName
-------------------
1 India
3 USA
4 Rasia

Query:-
SELECT Id, CountryName
  FROM Countries WHERE CountryName LIKE 'Indi_'

Result:-
Id CountryName
-------------------
1 India

Stayed Informed SQL Server Query and Examples

I hope you are enjoying with this post! Please share with you friends. Thank you!!
ANIL SINGH

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions