Skip to main content

Posts

Showing posts with the label SQL WHERE LIKE Statement

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. Stayed Informed   -   37 Best SQLServer Interview Questions and Answers 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' ...