Home > Article > Backend Development > Related knowledge about SQL SELECT statement
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
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:
##Understand the relevant syntax 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!