Home > Backend Development > PHP Tutorial > Related knowledge about SQL SELECT statement

Related knowledge about SQL SELECT statement

jacklove
Release: 2023-03-25 15:10:02
Original
1804 people have browsed it

SQL SELECT statement is very important in database operation. This article will explain it.

SQL SELECT statement

The SELECT statement is used to select data from a table.

The results are stored in a results table (called a result set).

SQL SELECT syntax

SELECT column name FROM table name

and:

SELECT * FROM table name

Note: SQL statements are not case sensitive. SELECT is equivalent to select.

SQL SELECT Example

To get the contents of the columns named "LastName" and "FirstName" (from the database table named "Persons"), use a SELECT statement similar to this :

SELECT LastName,FirstName FROM Persons
Copy after login

SQL SELECT * Example

Now we want to select all columns from the "Persons" table.

Please use the symbol * instead of column names, like this:

SELECT * FROM Persons

Tip: The asterisk (*) selects all columns A shortcut.

The results obtained by the SQL Query program are stored in a result set. Most database software systems allow programmingfunctionsnavigation in the result set, such as: Move-To-First-Record, Get-Record-Content, Move-To-Next-Record and so on.

This article provides relevant analysis of the SELECT statement. For more learning materials, please pay attention to the php Chinese website.

Related recommendations:

How to use JSON

##Understand the relevant syntax of json

Initial understanding of JSON

The above is the detailed content of Related knowledge about SQL SELECT statement. 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