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 :: mysql drop database 
Sql :: mysql cdn link 
Sql :: how to drop a table in mysql 
Sql :: script sql backup database sql server 
Sql :: row number mssql 
Sql :: recently updated stored procedure in sql server 
Sql :: how to export only procedures mysql 
Sql :: install squirrel sql ubuntu 
Sql :: select last row in sql 
Sql :: show the colums of table sql 
Sql :: sql blank vs null 
Sql :: sql pagination offset 
Sql :: how to insert ip address in mysql using php 
Sql :: sql convert date to string yyyy-mm-dd 
Sql :: alter table add multiple columns postgresql 
Sql :: mysql milliseconds 
Sql :: temp table vs variable table in sql server 
Sql :: mysql change default collation 
Sql :: mysql local password denied 
Sql :: oracle apex view logs 
Sql :: incompatible sql_mode=only_full_group_by 
Sql :: create function syntax sql server 
Sql :: adding constraints to columns SQL 
Sql :: sql paging query 
Sql :: mysql grant select update insert delete 
Sql :: alter column set not null to null postgres 
Sql :: where with multiple conditions in mongodb 
Sql :: sql cheatsheet 
Sql :: if column value is null then in mysql 
Sql :: count number of entires by months sql 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =