Collections:
LIKE - Matching a Pattern in a Character String in SQL Server
What To Perform Pattern Match with the LIKE Operator in SQL Server Transact-SQL?
✍: FYIcenter.com
Pattern match is a very important operation for search records base on character string columns. SQL Server 2005 offers the LIKE operator to perform pattern match operations in two formats:
target_string LIKE pattern -- Returns TRUE if the target string matches the pattern target_string NOT LIKE pattern -- Returns TRUE if the target string does not match the pattern
Pattern match is a powerful operation. But you need to remember several rules:
Here is a simple example of LIKE operator:
SELECT CASE WHEN
'FYIcenter.com' LIKE 'FYI%'
THEN 'Pattern matched.'
ELSE 'Pattern not matched.'
END;
GO
Pattern matched.
⇒ Using Wildcard Characters in LIKE Operations in SQL Server
⇐ IN - Testing Value in a Value List in SQL Server
⇑ Boolean Values and Logical Operations in SQL Server Transact-SQL
2017-01-21, 2225🔥, 0💬
Popular Posts:
How To Format Time Zone in +/-hh:mm Format in SQL Server Transact-SQL? From the previous tutorial, y...
How to download and install Microsoft .NET Framework Version 2.0 in SQL Server? .NET Framework Versi...
How To Convert a Unicode Strings to Non-Unicode Strings in SQL Server Transact-SQL? Since Unicode ch...
How To Calculate DATETIME Value Differences Using the DATEDIFF() Function in SQL Server Transact-SQL...
What Is the Difference Between GETDATE() and GETUTCDATE() in SQL Server Transact-SQL? The difference...