For examples :
ID - Description
01 - Mix Black
02 - Mix Red
03 - Mix Blue
How I can write a query to show the field like "Mi Bl" in a query?
For examples :
ID - Description
01 - Mix Black
02 - Mix Red
03 - Mix Blue
How I can write a query to show the field like "Mi Bl" in a query?
You can use LIKE with %:
SELECT * FROM your_table WHERE Description LIKE 'Mi%Bl%';
This query would give you these 2 results:
01 - Mix Black
03 - Mix Blue
% is a wildcard:
The percent sign represents zero, one, or multiple characters
Dim sql As String = "SELECT * FROM your_table WHERE Description LIKE 'Mi%Bl%'". Not my domain though. Just giving you something I came across that you might find useful. Source: stackoverflow.com/questions/13583209/…Use a LIKE clause with wildcard characters. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql
SELECT *
FROM YourTable
WHERE Description LIKE 'Mi%Bl%';
This is SQL Server syntax, but any RDBMS will have a similar wildcard you can use.
SELECT *
FROM `table`
where Description like '%Mi% %Bl%'
SELECT *
FROM Tablename
WHERE `Description` LIKE 'Mi%Bl%';
'%' character is used to match any number(0, 1 or more) of characters. So this will match to your below records and result set will be -
ID - Description
-------------------
01 - Mix Black
03 - Mix Blue