Home > Database > SQL > body text

What is the function of where phrase in sql command?

青灯夜游
Release: 2020-08-31 17:10:21
Original
10363 people have browsed it

The function of the where phrase in the sql command is to specify the selection criteria and filter records; if you need to conditionally select data from the table, you can add the WHERE clause to the SELECT statement.

What is the function of where phrase in sql command?

The WHERE clause is used to filter records. The WHERE clause is used to extract records that meet specified conditions.

To conditionally select data from a table, add a WHERE clause to the SELECT statement.

SQL WHERE syntax

SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
Copy after login

The following operators can be used in the WHERE clause:

##Note: In some versions of SQL, the operator <> can be written as !=.
OperatorDescription
=equals
<> is not equal to
> is greater than
< is less than
>=greater than or equal to
<=less than or equal to
BETWEENSearch for a certain pattern within a certain range
LIKE

Use WHERE clause

If you only want to select people living in the city "Beijing", we need to add a WHERE clause to the SELECT statement:

SELECT * FROM Persons WHERE City=&#39;Beijing&#39;
Copy after login
"Persons" table

Result:What is the function of where phrase in sql command?

For more related knowledge, please visit:What is the function of where phrase in sql command? PHP Chinese website

!

The above is the detailed content of What is the function of where phrase in sql command?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!