Source One Educational Society
   
Home | OS Install | MS-Office | Photoshop | SQL | Networking | HTML | Java | Model Papers | FAQ's | Health Tips | News | Jobs | Fun SMS
SQL Tutorial
SQL BASICS
o SQL INTRODUCTION
o SQL STATEMENTS
o SQL DISTINCT Statement
o SQL WHERE Clause
o SQL LIKE Condition
   
   
  Updated Soon...
 
 
SQL - (Structured Query Language)
   

The LIKE Condition

 

The LIKE condition is used to specify a search for a pattern in a column.

Syntax

 
SELECT column FROM table
WHERE column LIKE pattern
 

A "%" sign can be used to define wildcards (missing letters in the pattern) both before and after the pattern.

 

Using LIKE

 

The following SQL statement will return persons with first names that start with an 'K':

 
SELECT * FROM Persons
WHERE FirstName LIKE 'K%'
 

The following SQL statement will return persons with first names that end with an 'a':

 
SELECT * FROM Persons
WHERE FirstName LIKE '%a'
 

The following SQL statement will return persons with first names that contain the pattern 'la':

 
SELECT * FROM Persons
WHERE FirstName LIKE '%a'
 

The following SQL statement will return persons with first names that contain the pattern 'la':

 
SELECT * FROM Persons
WHERE FirstName LIKE '%la%'
 
 
 
 
 
 
 
Home  |  Aboutus  |  Post Your Content  |  Terms of Service  |  Advertisement with us  |  Tell a Friend  |  Contact us  |  Sitemap
© 2009 365edu. All Rights Reserved. Site by 365edu. Best view in 1024x768 resolution.