HOME | PHP Tutorial | CSS
facebook icon
AgerNic.com
WEB DEVELOPER SITE, HTML, CSS, PHP
HTML Tutorial

CSS Tutorial

SQL like syntax and example

SQL LIKE operator is used in a WHERE clause to search into database for a specified pattern in a column.
There are two wildcards used in conjunction with the LIKE operator:
1. % The percent (%) sign represents zero, one, or multiple characters 2. _ The underscore (_) represents a single character

LIKE Operator --- Description
WHERE Users LIKE 'a%' --- Finds any values that start with "a"
WHERE Users LIKE '%a' --- Finds any values that end with "a"
WHERE Users LIKE '%com%' --- Finds any values that have "com" in any position
WHERE Users LIKE '_e%' --- Finds any values that have "e" in the second position
WHERE Users LIKE 't_%_%' --- Finds any values that start with "t" and are at least 3 characters in length
WHERE Users LIKE 'g%e' --- Finds any values that start with "g" and ends with "e"

SQL LIKE Syntax
SELECT column1, column2, column3
your-tabel-name
WHERE columnS LIKE pattern;


SQL LIKE Examples - how to create - example


The following SQL statement selects all customers with Users starting with "c":

Example 1
SELECT * FROM ColumsName
WHERE Users LIKE 'c%';


The following SQL statement selects all customers with users that have "geo" in any position:

Example 2
SELECT * FROM Customers
WHERE CustomerName LIKE '%or%';

Note: You can also combine any number of conditions using AND or OR operators.


SQL like SQL like syntax and example - sql tutorial

3227. SQL Select data from a database., sql tutorial
SQL Select data from a database. sql tutorial
https://www.agernic.com/sql-tutorial/sql-select-data-from-database.html

2564. SQL AND & OR - SQL Tutorial

http://www.sql-tutorial.net/SQL-AND-OR.asp

2597. SQL - Syntax, sql tutorial
SQL - Syntax sql tutorial
http://www.agernic.com/sql-tutorial/sql-syntax.html

3285. PHP mysqli_connect () Function, sql tutorial
PHP mysqli_connect () Function sql tutorial
https://www.agernic.com/sql-tutorial/php-mysqli-connect-function.html

3284. PHP mysqli_query() Function - mysqli query, sql tutorial
PHP mysqli_query() Function - mysqli query sql tutorial
https://www.agernic.com/sql-tutorial/php-mysqli_query-function-database-mysqli.html

2576. SQL INSERT INTO - SQL Tutorial

http://www.sql-tutorial.net/SQL-INSERT-INTO.asp

Your add here
How to get PHP errors to display?
How to prevent sql injection in php mysqli
How do I get PHP errors to display - PHP error_reporting()
mysql_query(): The mysql extension is deprecated and will be removed i
Function eregi_replace() is deprecated in php - How to fix
PHP delete an element from an array
Uncaught Error: Call to undefined function MYSQL_NUM_ROWS() in
Deprecated: mysql_connect() mysql extension is deprecated and will be
mysqli_fetch_array() expects parameter 1 to be mysqli_result boolean g
SQL IN Operator - example
SQL BETWEEN Operator
SQL like syntax and example
SQL WHERE AND & OR multiple conditions
SQL create table primary key autoincrement
PHP mysqli_connect () Function
SQL COUNT(), AVG() and SUM() Functions
Display data from SQL database with MySQLi into php - html table
SQL CREATE DATABASE - example
SQL mysql order by columns, by date, by asc, by desc, random with PHP
PHP mysqli_query() Function - mysqli query
SQL delete row - SQL delete table
SQL update - SQL update select
Insert into SQL - Insert into table SQL - Insert data in sql
Login in PHP - simple login script with PHP MYSQL