SQL LIKE clause in Sqlserver

Total Post:341

Points:2389
 1037  View(s)
Ratings:
Rate this:
i want to use  LIKE clause How to use .
  1. Post:281

    Points:2003
    Re: SQL LIKE clause in Sqlserver

    The SQL LIKE clause is used to compare a value to similar values using wildcard operators. There are two wildcards used in conjunction with the LIKE operator:
    The percent sign (%)
    The underscore (_)
    The percent sign represents zero, one, or multiple characters. The underscore represents a single number or character. The symbols can be used in combinations.

    SELECT * FROM Customer

    WHERE CustomerName LIKE 'a%'

    GO

    SELECT * FROM Customer

    WHERE CustomerName LIKE '%a%'

    Go

    SELECT * FROM Customer

    WHERE CustomerName LIKE 'a_'

    Go

    SELECT * FROM Customer

    WHERE CustomerName LIKE '_a'

    GO

    SELECT * FROM Customer

    WHERE CustomerName LIKE '_a_'

     

      Modified On Apr-10-2018 06:03:26 AM

Answer