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

_ 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 :: select in select sql 
Sql :: mysql curdate between two dates 
Sql :: sql server function to calculate a percentage 
Sql :: update a column with another column in same table mysql 
Sql :: sql update from one table to another based on a id match 
Sql :: equi join in sql 
Sql :: desc sql 
Sql :: asp.net core sql server stored procedure 
Sql :: Power BI merge tables same columns 
Sql :: compare if is null sql 
Sql :: execution time of mysql query 
Sql :: triggers db 
Sql :: C# mysql update statement set value to null 
Sql :: mysql update one table from another table multiple columns 
Sql :: SQL SELECT AS Alias 
Sql :: specify regex check on column constraint sqlalchemy 
Sql :: UPDATE SQL RAHULDEV 
Sql :: MySql count occurences more than" 
Sql :: query builder doctrien return sql 
Sql :: call procedure in wordpress 
Sql :: sqlite3 get data from table c 
Sql :: from UCSC MySQL database Use database hg38. 
Sql :: select all column 
Sql :: mysql search like but first exact match 
Sql :: sqlite update where exists 
Sql :: oracle params value 
Sql :: how to set sql_mode for a query in CI model 
Sql :: oracle executing sqlplus commands and waiting for completion 
Sql :: Alter precision 
Sql :: sql server query field names 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =