Tuesday, August 18, 2015

LIKE operator in SQL Server

Usage of LIKE in SQL Server:

If we want to get the data which is partially matching then we need to use LIKE operator.
Example:
Get the list of employees whose name is starting with A
SELECT
       *
FROM
       dbo.Employee
WHERE
       EmployeeName LIKE 'A%'



Get the list of employees whose name is ending with K
SELECT
       *
FROM
       dbo.Employee
WHERE

       EmployeeName LIKE '%K'


Labels: , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home