How To Use Like Condition In SQL Server 2008

In this article I tell you how to show Like condition in SQL Server.
  • 2007

In this article I tell you how to show Like condition in SQL Server. Like is a clause which is used to match the pattern of string in a database table. It performs wildcard searches of valid search string values.

We have 4 types of wild cards:

  • % (percentage sign)
  • _ (underscore)
  • [] (square bracket)
  • [^] (square bracket with not sign)

Lets take an example:

Select table records of Students1Details. I want Students Name which starts with R character:

LIKE1.jpg

Now, I want Students Name which ends with R character:

LIKE2.jpg

Suppose I want Students Name starts with R and end with H character.

LIKE3.jpg

© 2020 DotNetHeaven. All rights reserved.