Search
 
SCRIPT & CODE EXAMPLE
 

SQL

like in mysql

SELECT name FROM products WHERE name LIKE '%Value1' OR name LIKE '%Value2';	 
Comment

MySQL LIKE

The LIKE operator is a logical operator that tests whether a string contains a specified pattern or not. Here is the syntax of the LIKE operator:

expression LIKE pattern ESCAPE escape_character

This example uses the LIKE operator to find employees whose first names start with a:

SELECT 
    employeeNumber, 
    lastName, 
    firstName
FROM
    employees
WHERE
    firstName LIKE 'a%';
    
    This example uses the LIKE operator to find employees whose last names end with on e.g., Patterson, Thompson:

SELECT 
    employeeNumber, 
    lastName, 
    firstName
FROM
    employees
WHERE
    lastName LIKE '%on';
    
    
    For example, to find all employees whose last names contain on , you use the following query with the pattern %on%

SELECT 
    employeeNumber, 
    lastName, 
    firstName
FROM
    employees
WHERE
    lastname LIKE '%on%';
Comment

mysql like in

SELECT * from fiberbox where field REGEXP '1740|1938|1940'; 
Comment

PREVIOUS NEXT
Code Example
Sql :: control files oracle 
Sql :: T sql less than date 
Sql :: group_concat mysql 
Sql :: mysql update 
Sql :: mysql order by on condition 
Sql :: declare variable in mysql 
Sql :: SQL FETCH FIRST Clause 
Sql :: sqlalchemy case insensitive like 
Sql :: postgres stored procedure 
Sql :: convert minutes to hours sql 
Sql :: mysql pad zeros 
Sql :: SQL/update 
Sql :: how to add new column with default value in sql server 
Sql :: unique sql 
Sql :: get last record deluge 
Sql :: how to check common records in 2 table 
Sql :: mysql join same table multiple times group by 
Sql :: postgres between dates 
Sql :: sql field equals multiple values 
Sql :: SQL Copy From Two Tables to One 
Sql :: rename temp table column name in sql server 
Sql :: create table if not exists 
Sql :: mysql join column order By and group By 
Sql :: how to declare variable date in mysql 
Sql :: mysql select smaller of two values 
Sql :: MySql query execution order: 
Sql :: oracle list partitions 
Sql :: MySQL error code 2068 
Sql :: how to create local postgres database 
Sql :: cast in sql server 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =