Home  >  Article  >  Backend Development  >  Related knowledge about SQL SELECT statement

Related knowledge about SQL SELECT statement

jacklove
jackloveOriginal
2018-05-08 09:39:591779browse

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:

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!

Statement:
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