Search
 
SCRIPT & CODE EXAMPLE
 

SQL

wildcard in sql

SELECT * FROM table_name WHERE UPPER(col_name) LIKE '%SEARCHED%';
SELECT * FROM table_name WHERE col_name LIKE '%Searched%';  -- Case sensitive

SYMBOL	DESCRIPTION	(SQL)                       EXAMPLE
%	    zero or more characters	                bl%      'bl, black, blue, blob'
_	    a single character	                    h_t      'hot, hat, hit'
[]	    any single character within brackets	h[oa]t   'hot, hat', but NOT 'hit'
^	    any character not in the brackets	    h[^oa]t  'hit', but NOT 'hot, hat'
-	    a range of characters	                c[a-b]t   'cat, cbt'
Comment

sql wildcard characters

% -- Equates to zero or more characters.
-- Example: Find all customers with surnames ending in ‘ory’.
SELECT * FROM customers
WHERE surname LIKE '%ory';

_ -- Equates to any single character.
-- Example: Find all customers living in cities beginning with any 3 characters, followed by ‘vale’.
SELECT * FROM customers
WHERE city LIKE '_ _ _vale';

[charlist] -- Equates to any single character in the list.
-- Example: Find all customers with first names beginning with J, K or T.
SELECT * FROM customers
WHERE first_name LIKE '[jkt]%';
Comment

_ Wildcard in SQL

SELECT *
FROM Customers
WHERE country LIKE 'U_';
Comment

[] Wildcard in SQL

SELECT *
FROM Customers
WHERE country LIKE 'U[KA]%';
Comment

! Wildcard in SQL

SELECT *
FROM Customers
WHERE last_name LIKE '[!DR]%';
Comment

% Wildcard in SQL

SELECT *
FROM Customers
WHERE last_name LIKE 'R%';
Comment

PREVIOUS NEXT
Code Example
Sql :: modify column name in tsql 
Sql :: sql server interview questions 
Sql :: sql select merge multiple values 
Sql :: Executing an update/delete query 
Sql :: join multiple tables 
Sql :: psotgres multiple values 
Sql :: sequelize with mysql nodejs 
Sql :: before delete trigger mysql 
Sql :: Adding a new table psql 
Sql :: minus vs except in sql 
Sql :: xamarin sql lite create table if not exist 
Sql :: sql stored procedure for access frontend 
Csharp :: reload scene unity 
Csharp :: unity set mouse cursor lock 
Csharp :: how to change scenes on collision unity 
Csharp :: unity check if space pressed 
Csharp :: how to get last child of gameobject in unity 
Csharp :: textmeshpro text 
Csharp :: c# remove last character from string 
Csharp :: unity 2d how to set an object or the mouse position 
Csharp :: c sharp list of strings 
Csharp :: c# get free space on drive 
Csharp :: regex for email c# 
Csharp :: unity movetowards 
Csharp :: C# previous method 
Csharp :: is letter c# 
Csharp :: convert array from string to int c# 
Csharp :: unity remove gameobject 
Csharp :: c# string capital first letter extension method 
Csharp :: how to move your character in unity 2d game 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =